-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New index.html format - vendor js #1918
Conversation
static find(node: Node): Placeholder { | ||
let placeholder = this.immediatelyAfter(node); | ||
return placeholder; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is the same as replacing
, except that it doesn't remove the node
.
Before, the replacing
function was used to replace the script assets/vendor.js
with @embroider/core/vendor.js
. Now, it simply finds the script @embroider/core/vendor.js
, it doesn't remove it, and it uses its position as a reference for immediatelyAfter
.
The reason I need all of this is because Fastboot scripts are still inserted by the compat-app-builder at this point, and we need to have the location of the vendor.js
script to insert them at the correct position:
// compat-app-builder.ts
if (this.fastbootConfig) {
// any extra fastboot vendor files get inserted into our
// html.implicitScripts section, after the regular implicit script
// (vendor.js) have been inserted.
for (let script of this.fastbootConfig.extraVendorFiles) {
html.insertScriptTag(html.implicitScripts, script, { tag: 'fastboot-script' });
}
}
c32ac67
to
5bcc0a2
Compare
…as the index.html is no longer the same when using embroider
5bcc0a2
to
dd6f153
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🎉
Context
Lately, we have been working on the inversion of control for the Vite build, we replaced script assets like
vendor.js
with virtual content Vite can request to Embroider.Until now, we have never changed the
index.html
file of the initial Ember app to handle virtualization: in stage 2, the compat-app-builder generates theindex.html
of the rewritten-app and inserts the virtual entry points. This rewritten file is the one consumed by Vite.Now that we have virtualized all the entry points, we are ready for the next step that will get us closer to the new blueprint: we are going to write the virtual entry points directly in the
index.html
of the initial Ember app so Vite will be able to consume it directly, without intermediate change.This PR handles
vendor.js
.