-
-
Notifications
You must be signed in to change notification settings - Fork 619
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
Overwriting config parameters through CLI #155
Comments
Hi, That's a great idea! I don't know if that would be helpful, but PostCSS CLI handles this in a nice manner. They have a https://github.com/postcss/postcss-cli/blob/master/index.js#L126 and then in your config you can: module.exports = ({ options }) => ({
map: options.map,
...
}); It actually would be great if that would be possible with the webpack CLI as well. I often need dynamically set const path = require('path');
module.exports = ({ options }) => ({
output: {
publicPath: `/${options.outputPath.split(path.sep).pop()}/`
}
...
}); Thanks! 😄 |
The example usage printed by the CLI is a bit misleading: Usage without config file: webpack <entry> [<entry>] --output [-o] <output>
Usage with config file: webpack The current implementation always tries to find a configuration file, using either a list of default names (e.g. The issue I see with the current implementation is that new I propose that any |
Send a PR |
@ev1stensberg see #358. |
Closed via #358 |
Do you want to request a feature or report a bug?
feature
What is the current behavior?
According to my understanding and tests, I can use webpack either in combination with a config file which includes the entry and output paths, or I can pass the entry and output path as CLI arguments. But both alternatives are mutually exclusive, i.e. I cannot overwrite the entry and output paths specified in a config file through CLI parameters, while still using the other specifications in the config file.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
I want to use a webpack.config.js AND overwrite the entry and output paths of that config file using CLI parameters.
If this is a feature request, what is motivation or use case for changing the behavior?
I need to change entry and output paths dynamically and depending on some context while keeping the other entries of an entry file.
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
This issue was moved from webpack/webpack#4895 by @bebraw. Orginal issue was by @fera0013.
The text was updated successfully, but these errors were encountered: