kristw opened a new pull request #5983: Update webpack bundle configuration
URL: https://github.com/apache/incubator-superset/pull/5983
 
 
   - 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 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to