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"}}