From 21150c7a1c78a3c1be8f340acaaba44e11f4c5cf Mon Sep 17 00:00:00 2001 From: "Andrew C. Dvorak" Date: Mon, 19 Mar 2018 15:33:56 -0700 Subject: [PATCH] fix: Compile demo CSS/JS during `npm run build` (#2437) 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 ``` --- demos/webpack.config.js | 1 + package.json | 2 +- test/build/goldens/build-config-dev-env.golden.json | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/demos/webpack.config.js b/demos/webpack.config.js index cba4e8b816b..d00844efa40 100644 --- a/demos/webpack.config.js +++ b/demos/webpack.config.js @@ -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/', }; diff --git a/package.json b/package.json index 58c2fe0eb3b..495d396b777 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/build/goldens/build-config-dev-env.golden.json b/test/build/goldens/build-config-dev-env.golden.json index 9ca47f7ed1b..38d3e0ab529 100644 --- a/test/build/goldens/build-config-dev-env.golden.json +++ b/test/build/goldens/build-config-dev-env.golden.json @@ -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", @@ -74,6 +75,7 @@ "typography": "/demos/typography.scss" }, "output": { + "path": "/build", "publicPath": "/assets/", "filename": "[name].css.js" }, @@ -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*/", @@ -139,6 +144,7 @@ "theme/index": "/demos/theme/index.js" }, "output": { + "path": "/build", "publicPath": "/assets/", "filename": "[name].js", "libraryTarget": "umd",