webpack/template contains a reasonable starter template.
This will produce, under
dist/
the following minimized files:dist/index.html
: from webpack/template/index.html. You can open it to see:show on the browser. This was added from JavaScript.Hello webpack
dist/index.js
: from webpack/template/index.js and anything in its import tree, e.g.:- webpack/template/main.scss: sass source. It gets embedded the the JavaScript output as a string, and the JavaScript then applies it to the page, making the font blue
lodash
third party library
You can also run this test with the development server on localhost:9000:which uses unminimized outptus, and automatically push reloads the page whenever you change any of the input files!
npm start
This shows how to produce a minimized fully embedded CSS file with webpack from a sass:That example produces a
cd webpack/sass
npm install
npm run build
xdg-open index.html
dist/main.css
file which is a compresesd combination of:- webpack/sass/main.scss
- normalize.css, added to the project as a regular
node_modules
package