-
-
Notifications
You must be signed in to change notification settings - Fork 603
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
cli(add): support for webpack config file #501
Conversation
module.exports = function add(...args) { | ||
const DEFAULT_WEBPACK_CONFIG_FILENAME = "webpack.config.js"; | ||
|
||
const filePaths = args.slice(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you slicing 3 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because first 3 args would be node path, webpack-cli path, add command.
4th item in the array would be everything after add command like the custom config path/name. So, we're slicing first three items to get the config path.
We can't directly use the last element of args
because that would be "add" if the user doesn't mention any arg after add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oki. let me check it out later to make sure its working 👍
packages/utils/resolve-packages.js
Outdated
@@ -3,7 +3,7 @@ | |||
const path = require("path"); | |||
const chalk = require("chalk"); | |||
|
|||
const modifyConfigHelper = require("./modify-config-helper"); | |||
const modifyConfig = require("./modify-config-helper"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't see a reason to change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency.
We're using modifyConfig
everywhere across at codebase other than this place.
Please check this: https://github.com/webpack/webpack-cli/search?q=return+modifyHelper&unscoped_q=return+modifyHelper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the previous convention 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated all occurrences to use the previous convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generator is defined twice in the modifyconfig helper & the generator is not runnable. Good work though!
🎉 This PR is included in version 3.0.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What kind of change does this PR introduce?
Feature
Did you add tests for your changes?
No
If relevant, did you update the documentation?
Yes
Summary
Add support to specify webpack config file with args, default to webpack.config.js
webpack-cli add webpack.dev.js
webpack-cli add
webpack-cli add aaahha.js
Similar usage for
update
,remove
.Does this PR introduce a breaking change?
No
Fixes #279