diff --git a/packages/compat/src/compat-app-builder.ts b/packages/compat/src/compat-app-builder.ts index 3cf10a4c3..ca3312f98 100644 --- a/packages/compat/src/compat-app-builder.ts +++ b/packages/compat/src/compat-app-builder.ts @@ -353,12 +353,6 @@ export class CompatAppBuilder { }); } - // our tests entrypoint already includes a correct module dependency on the - // app, so we only insert the app when we're not inserting tests - if (!asset.fileAsset.includeTests) { - html.insertScriptTag(html.javascript, '@embroider/core/entrypoint', { type: 'module' }); - } - if (this.fastbootConfig) { // any extra fastboot app files get inserted into our html.javascript // section, after the app has been inserted. diff --git a/packages/compat/src/compat-app.ts b/packages/compat/src/compat-app.ts index d2226e91f..483065d65 100644 --- a/packages/compat/src/compat-app.ts +++ b/packages/compat/src/compat-app.ts @@ -727,12 +727,11 @@ export default class CompatApp { } findAppScript(scripts: HTMLScriptElement[], entrypoint: string): HTMLScriptElement { - let appJS = scripts.find( - script => this.withoutRootURL(script.src) === this.legacyEmberAppInstance.options.outputPaths.app.js - ); + let moduleName = '/@embroider/core/entrypoint'; + let appJS = scripts.find(script => this.withoutRootURL(script.src) === moduleName); return throwIfMissing( appJS, - this.legacyEmberAppInstance.options.outputPaths.app.js, + moduleName, scripts.map(s => s.src), entrypoint, 'app javascript' diff --git a/packages/core/src/ember-html.ts b/packages/core/src/ember-html.ts index 5f0e4475f..ed8423b07 100644 --- a/packages/core/src/ember-html.ts +++ b/packages/core/src/ember-html.ts @@ -84,7 +84,7 @@ export class PreparedEmberHTML { constructor(private asset: EmberAsset) { this.dom = new JSDOM(readFileSync(asset.sourcePath, 'utf8')); let html = asset.prepare(this.dom); - this.javascript = Placeholder.replacing(html.javascript); + this.javascript = Placeholder.find(html.javascript); this.styles = Placeholder.replacing(html.styles); this.implicitScripts = Placeholder.find(html.implicitScripts); this.testJavascript = html.testJavascript diff --git a/packages/util/tests/dummy/app/index.html b/packages/util/tests/dummy/app/index.html index 92c6645e1..27bc57ad8 100644 --- a/packages/util/tests/dummy/app/index.html +++ b/packages/util/tests/dummy/app/index.html @@ -17,7 +17,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} diff --git a/test-packages/sample-transforms/tests/dummy/app/index.html b/test-packages/sample-transforms/tests/dummy/app/index.html index 44866f1ae..fb2ed81c0 100644 --- a/test-packages/sample-transforms/tests/dummy/app/index.html +++ b/test-packages/sample-transforms/tests/dummy/app/index.html @@ -18,7 +18,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} diff --git a/test-packages/sample-transforms/tests/index.html b/test-packages/sample-transforms/tests/index.html index 2710482a6..f4d73ac41 100644 --- a/test-packages/sample-transforms/tests/index.html +++ b/test-packages/sample-transforms/tests/index.html @@ -31,7 +31,7 @@ - + {{content-for "body-footer"}} diff --git a/tests/addon-template/tests/dummy/app/index.html b/tests/addon-template/tests/dummy/app/index.html index 92c6645e1..27bc57ad8 100644 --- a/tests/addon-template/tests/dummy/app/index.html +++ b/tests/addon-template/tests/dummy/app/index.html @@ -17,7 +17,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} diff --git a/tests/addon-template/tests/index.html b/tests/addon-template/tests/index.html index 15da9641c..a5ca7c1c6 100644 --- a/tests/addon-template/tests/index.html +++ b/tests/addon-template/tests/index.html @@ -30,7 +30,7 @@ - + {{content-for "body-footer"}} diff --git a/tests/app-template/app/index.html b/tests/app-template/app/index.html index 2450e01f3..44db13c65 100644 --- a/tests/app-template/app/index.html +++ b/tests/app-template/app/index.html @@ -17,7 +17,7 @@ {{content-for "body"}} - + {{content-for "body-footer"}} diff --git a/tests/app-template/tests/index.html b/tests/app-template/tests/index.html index 92444ebab..142e3ca56 100644 --- a/tests/app-template/tests/index.html +++ b/tests/app-template/tests/index.html @@ -27,7 +27,7 @@ - + {{content-for "body-footer"}} {{content-for "test-body-footer"}} diff --git a/tests/fixtures/macro-test/tests/index.html b/tests/fixtures/macro-test/tests/index.html index 8c40280e9..88283ec2c 100644 --- a/tests/fixtures/macro-test/tests/index.html +++ b/tests/fixtures/macro-test/tests/index.html @@ -36,7 +36,7 @@ - + {{content-for "body-footer"}} diff --git a/tests/scenarios/compat-addon-classic-features-test.ts b/tests/scenarios/compat-addon-classic-features-test.ts index c7e82d034..caf9d503c 100644 --- a/tests/scenarios/compat-addon-classic-features-test.ts +++ b/tests/scenarios/compat-addon-classic-features-test.ts @@ -82,7 +82,7 @@ appScenarios {{content-for "custom"}} - + {{content-for "body-footer"}} diff --git a/tests/scenarios/compat-app-html-attributes-test.ts b/tests/scenarios/compat-app-html-attributes-test.ts index aecc19de8..a6aed440a 100644 --- a/tests/scenarios/compat-app-html-attributes-test.ts +++ b/tests/scenarios/compat-app-html-attributes-test.ts @@ -32,7 +32,7 @@ appScenarios // - + {{content-for "body-footer"}} diff --git a/tests/ts-app-template/tests/index.html b/tests/ts-app-template/tests/index.html index cad5684b7..252331e41 100644 --- a/tests/ts-app-template/tests/index.html +++ b/tests/ts-app-template/tests/index.html @@ -30,7 +30,7 @@ - + {{content-for "body-footer"}}