Skip to content
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

Merged
merged 14 commits into from Mar 9, 2018

Conversation

acdvorak
Copy link
Contributor

@acdvorak acdvorak commented Feb 28, 2018

Fixes #1994

@acdvorak acdvorak changed the title chore: Extract webpack.demo.js from webpack.config.js chore: Move demo Webpack config to separate file Mar 9, 2018
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",
Copy link
Contributor

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?

Copy link
Contributor Author

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 🙂

@acdvorak acdvorak changed the title chore: Move demo Webpack config to separate file chore: Move demo Webpack config to separate file Mar 9, 2018
@acdvorak acdvorak merged commit 4c7f006 into master Mar 9, 2018
@acdvorak acdvorak deleted the chore/build/demo-webpack-config branch March 9, 2018 23:25
@codecov-io
Copy link

Codecov Report

Merging #2325 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b799a5...06ef11a. Read the comment docs.

acdvorak added a commit that referenced this pull request Mar 19, 2018
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()) {
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants