Skip to content

Commit

Permalink
chore: tweak babel config
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 1, 2021
1 parent c3b0946 commit cdc87fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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
4 changes: 2 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ function buildFile(file, silent) {
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',
// we want to lazyload all non-local modules - this is buggy though as it doesn't pick up `../` etc. We should consider just `: true` which works correctly or even () => true which would also transform any local imports
!string.startsWith('./'),
}),
];
}
Expand Down

0 comments on commit cdc87fe

Please sign in to comment.