-
-
Notifications
You must be signed in to change notification settings - Fork 622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typeError if passing a different webpack config filename in remove command #882
Comments
anikethsaha
changed the title
typeError if passing a different webpack config filename in remove-generator
typeError if passing a different webpack config filename in remove command
May 10, 2019
PR is welcome. We should adopt the some solution we use for We can't ask the user to rename their filename |
Can we use |
I wouldn't prompt to the user. Let's just fix the file resolution. I think for now it's enough. |
okk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
webpack-cli remove webpack.prod.js # any name other than webpack.config.js will throw error
What is the current behavior?
Throwing typeError and stopping the execution of the package.
To Reproduce
Steps to reproduce the behavior:
webpack.config.js
, something likewebpack.prod.js
or anything else$ webpack-cli remove webpack.prod.js
it will throw this.
Expected behavior
This is happeing because in
remove-generator.ts
if the config filename is not equal towebpack.config.js
then it is assigning theconfigPath
as null and thenrequire(configPath)
which is resulting in this errorFix
One way to fix this can be.
to ask the user for the correct webpack config file name , something like this.
or
To simply thow a nice error description from if-statement
Please paste the results of
webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: