From cb1edd32fbabd14f14798f60a2d3349b2110f8bc Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Fri, 28 Sep 2018 11:50:12 -0400 Subject: [PATCH] docs: Add build section to getting-started.md (#3672) --- docs/getting-started.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/getting-started.md b/docs/getting-started.md index a475e8a854a..3c7cc1d513e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -333,6 +333,27 @@ Now run `npm start` again and open http://localhost:8080. You should see a Mater Button with Ripple +### Step 5: Build Assets for Production + +Up to this point, we've used `webpack-dev-server` to preview our work with live updates. However, `webpack-dev-server` is not intended for production use. Instead, we should generate production-ready assets. + +Add another script to `package.json`: + +```json + "scripts": { + "build": "webpack -p", + "start": "webpack-dev-server" + } +``` + +Now run the following command: + +``` +npm run build +``` + +This will produce `bundle.js` and `bundle.css` in the project directory. These contain the compiled CSS and transpiled JS, which you can then copy into a directory served by any web server. + ## Appendix: Configuring a Sass Importer for Nested node_modules It is possible to end up with nested `node_modules` folders if you have dependencies on conflicting versions of