Make extension rewriting opt-in instead of opt-out

This commit is contained in:
Nick Gerleman
2023-10-19 20:23:46 -07:00
parent 8c60fb0924
commit a929b164ec
2 changed files with 5 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ module.exports = api => ({
[ [
'@babel/preset-typescript', '@babel/preset-typescript',
{ {
rewriteImportExtensions: !api.env('test'), rewriteImportExtensions: api.env('dist'),
}, },
], ],
], ],

View File

@@ -107,6 +107,10 @@ function babelTransformTask(opts) {
return spawn(node, [require.resolve('@babel/cli/bin/babel'), ...args], { return spawn(node, [require.resolve('@babel/cli/bin/babel'), ...args], {
cwd: __dirname, cwd: __dirname,
env: {
// Trigger distribution-specific Babel transforms
NODE_ENV: 'dist',
}
}); });
}; };
} }