- Add flags to enable speed measurement and bundle analyzer

```
npm run build -- --measure=true --analyzeBundle=true
```

- Update dependency versions (`css-loader`, `webpack-cli`)
- Remove `json-loader` which is not necessary for webpack 4

- Switch from default `UglifyjsPlugin` to `TerserPlugin` as minimizer. The 
`TerserPlugin` use an updated fork of `uglifyjs-es` under the hood while 
`UglifyjsPlugin` use `uglifyjs` version 3 which does not support es module. 
This let us enable `parallel` and `cache` options for some speed up in the 
build.

- After analyzing the bundles, define a special chunk for `brace`, `core-js` 
and `react-dom` which takes large portion of the three main entry points 
(dashboard, explore and sqllab). This will enable better caching and reduce 
size of the entry points. Somehow these modules were not automatically split 
into the common chunks as expected for default behavior.

Before
![image](https://user-images.githubusercontent.com/1659771/46116214-c4cce500-c1af-11e8-86bb-7a929f2c3bed.png)

After
![image](https://user-images.githubusercontent.com/1659771/46116317-5dfbfb80-c1b0-11e8-8fb9-e912bee823a5.png)


@williaster @xtinec 

[ Full content available at: 
https://github.com/apache/incubator-superset/pull/5983 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to