A collection of simple examples to explain how to configure Webpack
A collection of simple Webpack examples:
--env
flag to create different config based on the environment.import()
to load part of an app on demand.babel-loader
to transpile ES2015 code into into a backwards compatible version of javascript.html-webpack-plugin
.css-loader
and style-loader
to parse stylesheets and place them into html page.mini-css-extract-plugin
to extract stylesheets into a separate file.purgecss
to remove unused part of stylesheets.asset/resource
to parse and emit images and asset/source
to parse raw svg files.sass-loader
.postcss-loader
.mode.production
, css-minimizer-webpack-plugin
and HtmlWebpackPlugin.minify
.require.context()
at compile time to import assets.--inspect
tool.import()
.require.context()
to include all images from a folder and dynamically load them with import()
.webpack-merge
.HtmlWebpackPlugin
.