Skip to content

Commit e919b40

Browse files
committed
Pass extensions to load as modules to Babel provider
1 parent 6995471 commit e919b40

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/worker/subprocess.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,19 @@ ipc.options.then(options => {
112112
handleUncaughtExceptions: false
113113
});
114114

115+
const extensionsToLoadAsModules = Object.entries(options.moduleTypes)
116+
.filter(([, type]) => type === 'module')
117+
.map(([extension]) => extension);
118+
115119
// Install before processing options.require, so if helpers are added to the
116120
// require configuration the *compiled* helper will be loaded.
117121
let babelProvider;
118122
if (options.babelState !== null) {
119123
const {projectDir} = options;
120-
babelProvider = babelManager({projectDir}).worker({state: options.babelState});
124+
babelProvider = babelManager({projectDir}).worker({extensionsToLoadAsModules, state: options.babelState});
121125
runner.powerAssert = babelProvider.powerAssert;
122126
}
123127

124-
const extensionsToLoadAsModules = Object.entries(options.moduleTypes)
125-
.filter(([, type]) => type === 'module')
126-
.map(([extension]) => extension);
127-
128128
let requireFn = require;
129129
const load = ref => {
130130
for (const extension of extensionsToLoadAsModules) {

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"yargs": "^15.1.0"
111111
},
112112
"devDependencies": {
113-
"@ava/babel": "^0.5.0",
113+
"@ava/babel": "^0.6.0",
114114
"@types/node": "^10.17.13",
115115
"ansi-escapes": "^4.3.0",
116116
"delay": "^4.3.0",

0 commit comments

Comments
 (0)