Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
fix: Compile demo CSS/JS during npm run build (#2437)
Browse files Browse the repository at this point in the history
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
    ```
  • Loading branch information
acdvorak authored Mar 19, 2018
1 parent 6417b51 commit 21150c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions demos/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const jsBundleFactory = new JsBundleFactory({env, pathResolver, globber, pluginF
const DEMO_BASE_DIR_ABSOLUTE_PATH = pathResolver.getAbsolutePath('/demos');

const OUTPUT = {
fsDirAbsolutePath: pathResolver.getAbsolutePath('/build'),
httpDirAbsolutePath: '/assets/',
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Material Components Web",
"license": "Apache-2.0",
"scripts": {
"build": "npm run clean && mkdirp build && webpack --progress --colors",
"build": "npm run clean && mkdirp build && webpack --progress --colors && webpack --config=demos/webpack.config.js --progress --colors",
"build:min": "mkdirp build && cross-env MDC_ENV=production webpack -p --progress --colors",
"changelog": "standard-changelog -i CHANGELOG.md -k packages/material-components-web/package.json -w",
"clean": "del-cli build/** build .closure-tmp/** .closure-tmp",
Expand Down
6 changes: 6 additions & 0 deletions test/build/goldens/build-config-dev-env.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"name": "main-js-combined",
"entry": "/packages/material-components-web/index.js",
"output": {
"path": "/build",
"publicPath": "/assets/",
"filename": "material-components-web.js",
"libraryTarget": "umd",
Expand Down Expand Up @@ -74,6 +75,7 @@
"typography": "/demos/typography.scss"
},
"output": {
"path": "/build",
"publicPath": "/assets/",
"filename": "[name].css.js"
},
Expand Down Expand Up @@ -122,6 +124,9 @@
"id": 5,
"options": {}
},
{
"cleanupDirRelativePath": "/build"
},
{
"options": {
"banner": "/*!\n Material Components for the Web\n Copyright (c) 2018 Google Inc.\n License: Apache-2.0\n*/",
Expand All @@ -139,6 +144,7 @@
"theme/index": "/demos/theme/index.js"
},
"output": {
"path": "/build",
"publicPath": "/assets/",
"filename": "[name].js",
"libraryTarget": "umd",
Expand Down

0 comments on commit 21150c7

Please sign in to comment.