Skip to content

Commit

Permalink
feat(new index.html): pass the entrypoint from app to rewritten-app
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueCutOfficial committed May 16, 2024
1 parent 9256886 commit 95be548
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/compat/src/compat-app-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ 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 (!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
Expand Down
7 changes: 3 additions & 4 deletions packages/compat/src/compat-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -701,12 +701,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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/ember-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 95be548

Please sign in to comment.