Skip to content

Commit

Permalink
chore: tweak babel config (#11918)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Oct 1, 2021
1 parent c3b0946 commit a5ee117
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module.exports = {
'@babel/preset-env',
{
bugfixes: true,
// a runtime error is preferable, and we need a real `import`
exclude: ['@babel/plugin-proposal-dynamic-import'],
// we manually include the CJS plugin above, so let's make preset-env do less work
modules: false,
shippedProposals: true,
targets: {node: supportedNodeVersion},
},
Expand Down
9 changes: 1 addition & 8 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,7 @@ function buildFile(file, silent) {
Array.isArray(plugin) &&
plugin[0] === '@babel/plugin-transform-modules-commonjs'
) {
return [
plugin[0],
Object.assign({}, plugin[1], {
lazy: string =>
// we want to lazyload all non-local modules plus `importEsm` - the latter to avoid syntax errors. Set to just `true` when we drop support for node 8
!string.startsWith('./') || string === './importEsm',
}),
];
return [plugin[0], Object.assign({}, plugin[1], {lazy: true})];
}

return plugin;
Expand Down

0 comments on commit a5ee117

Please sign in to comment.