You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the current behavior?
in $ npx webpack-cli init command, In the second question, it is asking for the entry point and the default is dist but if we write the entrypoint in the answer then also it is keeping dist only in the webpack.config.js which is generated
To Reproduce
Steps to reproduce the behavior:
RUN : $ npx webpack-cli init
In 1st question , select n and then in the second question Which module will be the first to enter the application? [default: ./src/index] give any path for entry like ./index.js or any path or filename
in the webpack.config.js file generated, it won't write any entry property as it is taking the dist which is the default one
Expected behavior
It should have an entry property with the value as the answer passed for 2nd question in a path resolved method
Fix
line causing the bug:
in this line
The first if statement will run always even though it is getting '[file-or-pathname]' from here as it will always return '' and its length will be greater than 0 and type is always string
To Fix this :
in line change replacing the existing with this one work fine.
.then(
(entryOptions: object | string): Promise<{}> => {
if (typeof entryOptions === "string"&& entryOptions.length > 0) {
if (entryOptions !== "\"\""&& entryOptions !== "\'\'") {
this.configuration.config.webpackOptions.entry = entryOptions;
}
}
return this.prompt([
Input("outputType", "In which folder do you want to store your generated bundles? (dist):")
]);
}
)
I have tested this and it's working fine in all types of answers for that.
Please paste the results of webpack-cli info here, and mention other relevant information
Describe the bug
What is the current behavior?
in
$ npx webpack-cli init
command, In the second question, it is asking for the entry point and the default isdist
but if we write the entrypoint in the answer then also it is keepingdist
only in thewebpack.config.js
which is generatedTo Reproduce
Steps to reproduce the behavior:
$ npx webpack-cli init
n
and then in the second question Which module will be the first to enter the application? [default: ./src/index] give any path for entry like./index.js
or anypath or filename
entry
property as it is taking thedist
which is the default oneExpected behavior
It should have an
entry
property with the value as the answer passed for 2nd question in a path resolved methodFix
line causing the bug:
in this line
The first if statement will run always even though it is getting
'[file-or-pathname]'
from here as it will always return''
and its length will be greater than 0 and type is alwaysstring
To Fix this :
in line change replacing the existing with this one work fine.
I have tested this and it's working fine in all types of answers for that.
Please paste the results of
webpack-cli info
here, and mention other relevant informationUpdated
Changed the step to reproduce question to correct one.
The text was updated successfully, but these errors were encountered: