Basic and advanced guide for Webpack in an incremental way. It is incremental because there are 8 examples (8 folders). Each has a webpack.config.js
and complements the previous tutorial. For example, Example 2 (Minify) complements Example 1 (Basic), and so on.
git clone https://github.com/Imballinst/webpack-incremental-tutorial
cd webpack-incremental-tutorial
npm install
There are 8 examples (as stated above) in this repository. Run these commands on your root directory.
- Basic - Complete Asset Loaders:
npm run build:1
- Advanced - Minify Assets:
npm run build:2
- Advanced - Hash:
npm run build:3
- Advanced - Code Splitting:
npm run build:4
- Advanced - Build Performance:
npm run build:5
- Advanced - Vendor Assets Filtering:
npm run build:6
- Advanced - Tree Shaking:
npm run build:7
- Advanced - Conditional Build:
npm run build:8
- Clear cache folder (for example #5 and above):
npm run cache:clear
The test contained in this repository has only one purpose: to make sure that no code is unused or out of context with eslint. To run the test: npm test
.
For complete guide, please check Webpack's guides section.