Skip to content

Commit 6dc8bbe

Browse files
committed
fix deprecation on ember beta
1 parent 5195674 commit 6dc8bbe

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/node-main.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,17 @@ async function handleNodeSpecificOptions(opts: Options): Promise<SharedOptions>
5757
assertTemplateCompiler(opts.compiler);
5858
compiler = opts.compiler;
5959
} else if ((opts.targetFormat ?? 'wire') === 'wire') {
60-
let mod: any = await cwdImport('ember-source/dist/ember-template-compiler.js');
60+
let mod: any;
61+
try {
62+
// the newer path
63+
mod = await cwdImport('ember-source/ember-template-compiler/index.js');
64+
} catch (err: any) {
65+
if (err.code !== 'ERR_MODULE_NOT_FOUND') {
66+
throw err;
67+
}
68+
// the deprecated path
69+
mod = await cwdImport('ember-source/dist/ember-template-compiler.js');
70+
}
6171
assertTemplateCompiler(mod);
6272
compiler = mod;
6373
}

0 commit comments

Comments
 (0)