-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
webpack-cli init
creates invalid config w/ Webpack v3.5.4: configuration.output.path: The provided value "public" is not an absolute path!
#177
Comments
Hm, weird.. This should have been fixed in #125 . Maybe we've forgotten to publish to npm, though less likely. |
OK, I think I get it. If I accept the default target directory of webpack-cli/lib/creator/yeoman/webpack-generator.js Lines 77 to 80 in a69c7a9
% $(npm bin)/webpack-cli init
Insecure about some of the questions?
https://github.com/webpack/webpack-cli/blob/master/INIT.md
? Will your application have multiple bundles? Yes
? Type the name you want for your modules (entry files), separated by comma upload,download
? What is the location of 'upload'? ./frontend/src/upload
? What is the location of 'download'? ./frontend/src/download
+ ? Which folder will your generated bundles be in? [default: dist]:
? Are you going to use this in production? Yes
? Will you be using ES2015? Yes
? Will you use one of the below CSS solutions? CSS
? If you want to bundle your CSS files, what will you name the bundle? (press enter to skip)
? Name your 'webpack.[name].js?' [default: 'prod']:
# ...
Congratulations! Your new webpack configuration file has been created! Output: output: {
filename: '[name].[chunkhash].js',
chunkFilename: '[name].[chunkhash].js',
+ path: path.resolve(__dirname, 'dist')
}, But with a custom output directory: % $(npm bin)/webpack-cli init
Insecure about some of the questions?
https://github.com/webpack/webpack-cli/blob/master/INIT.md
? Will your application have multiple bundles? Yes
? Type the name you want for your modules (entry files), separated by comma upload,download
? What is the location of 'upload'? ./frontend/src/upload
? What is the location of 'download'? ./frontend/src/download
- ? Which folder will your generated bundles be in? [default: dist]: dist2
? Are you going to use this in production? Yes
? Will you be using ES2015? Yes
? Will you use one of the below CSS solutions? CSS
? If you want to bundle your CSS files, what will you name the bundle? (press enter to skip)
? Name your 'webpack.[name].js?' [default: 'prod']:
# ...
Congratulations! Your new webpack configuration file has been created! Output: output: {
filename: '[name].[chunkhash].js',
chunkFilename: '[name].[chunkhash].js',
- path: 'dist2'
}, |
Yep, that's correct. It's a quick change. If you wanna submit a PR, I'd happy to help you! - |
See PR #178 |
Do you want to request a feature or report a bug?
Feels like a bug.
What is the current behavior?
Throws an error when running
webpack-cli init
thenwebpack --config webpack.prod.js
(see below)If the current behavior is a bug, please provide the steps to reproduce.
Ran
$ npx webpack-cli init
from Terminal and it generates an error when I run$(npm bin)/webpack --config webpack.prod.js
:What is the expected behavior?
Code generated by
webpack-cli init
should compile and run successfully.If this is a feature request, what is motivation or use case for changing the behavior?
Using Node 8.3.0 on macOS Sierra.
And here is my generated Webpack config (minus comments for brevity):
The text was updated successfully, but these errors were encountered: