manually setup module transforms so to support async imports in webpack (#44413)

This commit is contained in:
Spencer 2019-08-29 14:04:12 -07:00 committed by GitHub
parent dd7ea467a0
commit 4f4bb02299
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -6,6 +6,7 @@
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.5.1",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-modules-commonjs": "^7.5.0",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react":"^7.0.0",
"@babel/preset-typescript": "^7.3.3",

View file

@ -24,12 +24,15 @@ module.exports = () => {
require.resolve('@babel/preset-env'),
{
useBuiltIns: 'entry',
modules: 'cjs',
modules: false,
corejs: 3,
},
],
require('./common_preset'),
],
plugins: [require.resolve('@babel/plugin-syntax-dynamic-import')],
plugins: [
require.resolve('@babel/plugin-transform-modules-commonjs'),
require.resolve('@babel/plugin-syntax-dynamic-import'),
]
};
};