Wonderful Webpack tips
1 Jan 0001
One-minute read
Here are my recently learnt tips for advanced usage of the wonderful Webpack
--hot
does not do would you would expect.webpack --watch
andwebpack-dev-server
do what you'd expect--hot
to do, even without that option.--lazy
stops WDS from doing what you'd expect--hot
to do.--hot
allows modules (files) to be updated in place, without reloading the webpage.--open
is pretty handy--inline
can be moved towebpack.config.js
- Webpack has built in support for lazy loading through the AMD spec for
require()
:require.ensure()
- Support for multiple bundles (entry points) is beautiful
- WDS serves up static files if you keep them in the context path, with no additional config
What I have not answered yet, is what the the advantage of stylesheet bundles is, if the styles are cached in the browser along with the JavaScript bundle?