Example code for the talk on Webpack.
- A simple project with
webpack.config.js
- Stamping builds with a
hash
in filename - JS/JSX transpilation via
babel
- Adding
index.html
viaHtmlWebpackPlugin
- Add CSS support
- Loading images with
file-loader
- Aliasing module names for shorter imports
- Code splitting with
vendor
entry +CommonsChunkPlugin
- Using
DefinePlugin
to introduce env vars - Using
ProvidePlugin
for supplying modules for free vars - Lazy loading components
-
historyApiFallback
withreact-router-dom
- React HMR with
react-hot-loader
- Dev and Prod configurations using
webpack-merge
- Adding Unit testing with Karma/Mocha/Chai/Sinon