-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
chore: Move demo Webpack config to separate file #2325
Conversation
package.json
Outdated
@@ -9,11 +9,11 @@ | |||
"clean": "del-cli build/** build .closure-tmp/** .closure-tmp", | |||
"commitmsg": "validate-commit-msg", | |||
"dist": "npm run build && npm run build:min", | |||
"dev": "npm run clean && cross-env MDC_ENV=development webpack-dev-server --progress --content-base demos --inline --hot --host 0.0.0.0", | |||
"fix:js": "eslint --fix packages test webpack.config.js karma.conf.js", | |||
"dev": "npm run clean && cross-env MDC_ENV=development webpack-dev-server --progress --content-base demos --inline --hot --host 0.0.0.0 --config=demos/webpack.config.js", |
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.
When do we set the config to /webpack.config.js
for production?
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.
The build
, build:min
, and dist
commands are used for production builds, so they remain unchanged. If you don't specify a config file, Webpack implicitly uses /webpack.config.js
by default.
dev
is only used for demos 🙂
Codecov Report
@@ Coverage Diff @@
## master #2325 +/- ##
=======================================
Coverage 98.85% 98.85%
=======================================
Files 100 100
Lines 4118 4118
Branches 527 527
=======================================
Hits 4071 4071
Misses 47 47 Continue to review full report at Codecov.
|
Fixes a regression introduced by #2325. Supersedes #2433. To verify: 1. Build and deploy to staging server: ```bash MDC_ENV=development npm run build && gcloud app deploy app.yaml --project google.com:mdc-web-dev --version $USER ``` 2. View the staging server: ``` http://$USER.material-components-web.appspot.com ```
}; | ||
|
||
if (env.isDev()) { |
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.
FYI this got lost in translation and I suspect this may be the real cause of what we attempted to address in #2437. I think we should revert that and re-integrate this check.
Currently in master, isDev()
is never checked whatsoever, #2437 causes npm run build
to unconditionally always build both demo files and dist files, and the fact that we patched the build
target rather than the webpack configs means this regression slipped by test:buildconfig
unnoticed.
Fixes #1994