]> source.dussan.org Git - gitea.git/commitdiff
fix webpack polyfills (#9735)
authorsilverwind <me@silverwind.io>
Sun, 12 Jan 2020 20:53:12 +0000 (21:53 +0100)
committerAntoine GIRARD <sapk@users.noreply.github.com>
Sun, 12 Jan 2020 20:53:12 +0000 (21:53 +0100)
webpack polyfills did not work because useBuiltIns: 'entry' expects a
explicit core-js import. Changed it to 'usage' which does not require
these explicit imports and polyfills based on browserslist.

As a result, the built index.js now went from 128kB to 192kB.

Ref: https://babeljs.io/docs/en/babel-preset-env#usebuiltins

Co-authored-by: zeripath <art27@cantab.net>
webpack.config.js

index 7efde9503e5f3139f4660aed0a8fb5df88950a5b..b53934c621d9a1f3ce7c489debfc4c7004f08fe9 100644 (file)
@@ -36,7 +36,7 @@ module.exports = {
               [
                 '@babel/preset-env',
                 {
-                  useBuiltIns: 'entry',
+                  useBuiltIns: 'usage',
                   corejs: 3,
                 }
               ]