Skip to content

Commit 5c48fdd

Browse files
oskarleonardScriptedAlchemy
authored andcommitted
docs(readme):Updated the webpack part of the README (#127)
1 parent bc017ee commit 5c48fdd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,14 @@ With **webpack.optimize.CommonsChunkPlugin** plugin no longer part of Webpack 4,
144144

145145
> There are more aggressive ways to code split, thanks to webpack 4. Check out the RUC Readme if you are looking for a more aggressive code split optimization configuration. These are just examples, you should be able to configure them as you see fit
146146
147+
- `splitChunks`: Adding this to your `dev-webpack` will help with HMR when changing file names (or moving the files) which are dynamically imported. If you dont add this to your dev-webpack you might get this error: `Runtime TypeError: Cannot read property 'call' of undefined at __webpack_require__`. Could be related to this webpack issue: https://github.com/webpack/webpack/issues/6094. Adding it to your `prod-webpack` could unfortunately increase your total file size about 15% (in my test project), this is because you are changing webpacks defualt `chunks: async` to `chunks: 'initial'`
148+
- `runtimeChunk`: removed a hmr warning in chrome dev console, which got printed when starting the dev server. What it does and why it is needed together with `bootstrap` would be nice if someone else could make a PR for.
149+
- `minimizer: { UglifyJSPlugin`: Override the default UglifyjsWebpackPlugin minimizer with custom settings. These settings are probably default by now. They didnt do anything to the bundle size in my test project. Install instructions: https://webpack.js.org/plugins/uglifyjs-webpack-plugin/
150+
147151
*webpack.config.js:*
148152
```js
149153
const ExtractCssChunks = require("extract-css-chunks-webpack-plugin")
154+
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
150155

151156
module.exports = {
152157
module: {
@@ -169,7 +174,7 @@ module.exports = {
169174
optimization: {
170175
// FOR PRODUCTION
171176
minimizer: [
172-
new UglifyJSPlugin({
177+
new UglifyJsPlugin({
173178
uglifyOptions: {
174179
output: {
175180
comments: false,

0 commit comments

Comments
 (0)