-
Notifications
You must be signed in to change notification settings - Fork 993
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
Add yarn rw dev
option to pass any Webpack config as a string
#904
Conversation
packages/cli/src/commands/dev.js
Outdated
.positional('webpackConfig', { | ||
alias: 'wpc', | ||
description: | ||
'Optional string of Webpack DevServer config options, e.g. `--wpc="--port=1234"`', | ||
type: 'string', | ||
}) |
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.
Ooh, I love this... This is what I've wanted for a long time.
Could we make it more generic? Cause I would like to make this also work for jest, lint, etc.
Maybe something like --forward
. In yarn and npm this used to just be --
: yarn test -- --watchAll
, but I don't think that'll work anymore.
Yargs "Stop Parsing" ForwarderYargs does have an option to use However, when I try to run using warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.
...
Invalid values:
Argument: side, Given: "blahBlahblahBlah", Choices: "api", "web"
error Command failed with exit code 1. Bummer |
@peter this is ready to merge per your approval:
I'm creating a PR with CLI doc update now. |
Doc updated here: |
Thanks! When can we expect a new stable release? |
@styfle By end of today!! |
Fix #890
This is an alternate, mutual approach to #891 We could merge both and add to CLI docs for
yarn rw dev
@peterp My approach here is to add a string option to the Yargs command, which could be used to pass any+all Webpack DevServer config options, which will override
webpack.development.js
.Most importantly --> What do you this of this approach?
Secondarly --> does the code implementation pass your PeterPSniffTest™?
edit: Oh, one question. Should the name of the option be
webpack-config
orwebpackConfig
for CLI option?