Learn how to setup Webpack 2 and hot reload your CSS or SASS.
- Clone this repo
- Run
npm install
to install all the dependencies - Run
npm run dev
for development mode - New browser window should open automatically.
// list all files in scr and subfolders
eslint src/**/*.js webpack.config.js
npm run lint -s
// fix listed issues automatically
npm run lint -s -- --fix
If you are having issues with pug-html-loader, try to install pug-loader and change the loader inside of package.json to use: 'pug-loader'
. That should fix it.
Or simply remove pug template and use pure html.
If you are on pc you will need to type the word SET
before the NODE_ENV in package.json.
"prod": "npm run clean && SET NODE_ENV=production webpack -p"
If you want to set NODE_ENV for both Mac and PC you can use cross-env
like this:
"prod": "npm run clean && cross-env NODE_ENV=production webpack -p"
Don't forget to subscribe to my channel for more front-end videos.