Skip to content

Commit 3608a1f

Browse files
authored
Merge pull request #1939 from embroider-build/align-package-json-babel-filter
Output `_babel_filter_.js` in the `.embroider` folder
2 parents 0d42d71 + 719adb5 commit 3608a1f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/compat/src/compat-app-builder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ export class CompatAppBuilder {
570570
'utf8'
571571
);
572572
writeFileSync(
573-
join(this.root, '_babel_filter_.js'),
573+
join(locateEmbroiderWorkingDir(this.compatApp.root), '_babel_filter_.js'),
574574
babelFilterTemplate({ skipBabel: this.options.skipBabel, appRoot: this.origAppPackage.root }),
575575
'utf8'
576576
);

test-packages/support/transpiler.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ export class Transpiler {
3434
}
3535

3636
shouldTranspile(relativePath: string) {
37-
let shouldTranspile = require(join(this.appOutputPath, '_babel_filter_'));
37+
// Depending on how the app builds, the babel filter is not at the same location
38+
let embroiderLocation = join(locateEmbroiderWorkingDir(this.appDir), '_babel_filter_.js');
39+
let shouldTranspile = existsSync(embroiderLocation)
40+
? require(embroiderLocation)
41+
: require(join(this.appOutputPath, '_babel_filter_'));
3842
return shouldTranspile(join(this.appDir, getRewrittenLocation(this.appDir, relativePath))) as boolean;
3943
}
4044

0 commit comments

Comments
 (0)