to run this repo webpack v4 in your local,
On Command line
- Clone this repo:
git clone https://github.com/nagarakesh4/webpack-v4-gettingstarted.git
- Install webpack v4 modules from package.json:
npm install
you may use yarn as well
- To run development mode:
npm run dev
under ./dist/main.js you can verify the babel converted js file as unminfied
- To run production mode:
npm run build
under ./dist/main.js you can verify the babel converted js file as minified
-
No need to maintain a separate config.js file to store entry point (input file and output file), instead webpack just looks for ./src/index.js
-
Development and production mode can be easily set with --mode flag (look in package.json file), and for production mode, TreeShaking, ScopeHoisting and Minification are out of box (and no need of UglifyJS plugin etc...,)