• Vihang Mehta's avatar
    Upgrade webpack · b5a77be9
    Vihang Mehta authored
    Summary:
    `storybook` + `html-webpack-plugin` seem to not play nicely with webpack4. https://github.com/storybookjs/storybook/issues/9216
    Force resolving `html-webpack-plugin` to a new alpha version seems to work.
    
    `babel` modules need to be upgraded to address `.mjs` files. https://github.com/babel/babel/issues/8462
    
    `favicons-webpack-plugin` needs to be upgraded to handle API changes for webpack plugins https://github.com/jantimon/favicons-webpack-plugin/issues/222
    Upgrading to the new alpha version seems to work.
    
    A handful of other plugins also don't work due to API changes in webpack but upgrading them to their latest stable versions works.
    
    Test Plan:
    Build time perf for Webpack4:
    ```
    === PHASE SUMMARY INFORMATION ===
    
    Total launch phase time         1.200 s    0.59%
    Total init phase time           0.342 s    0.17%
    Total target pattern evaluation phase time    1.228 s    0.61%
    Total interleaved loading-and-analysis phase time    1.807 s    0.89%
    Total preparation phase time    0.058 s    0.03%
    Total execution phase time    197.507 s   97.70%
    Total finish phase time         0.013 s    0.01%
    ------------------------------------------------
    Total run time                202.157 s  100.00%
    
    Critical path (197.212 s):
           Time Percentage   Description
       91.785 s   46.54%   action 'Generating webpack deps src/ui/ui-deps.tar.gz'
       10.071 s    5.11%   action 'Generating licenses src/ui/npm_licenses.json'
        40.3 ms    0.02%   action 'Executing genrule //tools/licenses all_licenses'
       95.316 s   48.33%   action 'Generating webpack bundle src/ui/ui-bundle.tar.gz'
    ```
    
    Build time perf for Webpack5:
    ```
    === PHASE SUMMARY INFORMATION ===
    
    Total launch phase time         0.020 s    0.01%
    Total init phase time           0.180 s    0.09%
    Total target pattern evaluation phase time    0.118 s    0.06%
    Total interleaved loading-and-analysis phase time    0.145 s    0.07%
    Total preparation phase time    0.007 s    0.00%
    Total execution phase time    207.184 s   99.77%
    Total finish phase time         0.004 s    0.00%
    ------------------------------------------------
    Total run time                207.660 s  100.00%
    
    Critical path (207.116 s):
           Time Percentage   Description
       93.509 s   45.15%   action 'Generating webpack deps src/ui/ui-deps.tar.gz'
       10.430 s    5.04%   action 'Generating licenses src/ui/npm_licenses.json'
        30.0 ms    0.01%   action 'Executing genrule //tools/licenses all_licenses'
      103.148 s   49.80%   action 'Generating webpack bundle src/ui/ui-bundle.tar.gz'
    ```
    
    Reviewers: #engineering, michelle, nick
    
    Reviewed By: #engineering, michelle, nick
    
    Subscribers: nick
    
    Differential Revision: https://phab.corp.pixielabs.ai/D6761
    
    GitOrigin-RevId: 6584b9806e6c35138b721af6e522b6da7a60b36b
    b5a77be9
Analyzing file…