Notes:
Not every hint apply to all apps. Some hints have positive and negative effects so it depends on your needs.
Hints are ordered by importance (most important comes first), but importance heavily depends on the app.
Hints are categorized by App, Developer and/or Build performance. Sometimes multiple categories apply.
App performance: Your app perform better. This affects the user of your app and/or the cost of serving the app to the user.
Developer performance: This makes it easier for your developers to write the app.
Build performance: The build of your app is faster and/or more stable.
UglifyJsPlugin
(App, for every app)DefinePlugin
to pass configuration from config to app: Embedded into bundle, Conditional code is removed with minimized (App, for apps with configuration)EnvironmentPlugin
to pass process.env
from build to appstats-webpack-plugin
or the --json
CLI option to get the statsprofile
option to gather more performance statsnpm dedupe
/npm 4
and the DedupePlugin
: improve total download size (App, for app using npm)LimitChunkCountPlugin
, MinChunkSizePlugin
, AggressiveMergingPlugin
, )imports-loader
/exports-loader
to make it compatible: Easier to upgrade to new version (Developer, for every app)babel-loader
to transform ES6 module syntax to CommonJSoutput.library
to build libraries that export stuff (Developer, for libraries)externals
to declare dependencies of your bundle on the target environment (Developer, for libraries and apps)react-hot-loader
or react-transform
style-loader
(without extract-text-webpack-plugin
) for HMRresolve.root
to configure a path to your app modules: Allows shorter references to dependencies (Developer, for big apps)karma
with karma-webpack
to test modules in the browser (Developer, for every app)target
to build for other environments than the browser (Developer, for non-browser apps)BannerPlugin
to add comments to the output assets: Licensing (Developer, for libraries)debug
to switch loaders to debug mode which provide more debug information (if the loader supports it): Better debugging experiance (Developer, for every app)include
instead of exclude
in module.loaders
: less error prone and easier to add paths (Developer, for every app)watchOptions.poll
option only if watching over network or inside of VMsmodule.noParse
for big CommonJS files without dependencies: Faster build times (Build, for app with these modules)Feel free to add more hints to any category. If you were to add it or in which order you can add it to the
Unsorted
section and some more experienced user will pick it up.