-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix: only inject entry scripts as <script>
#46
Conversation
I think this comes from the webpack requirement of self-registering chunks. Can you please try if webpack (dynamic chunks) works fine with this change? Also what are benefits of not doing this? Less HTML size? |
Yes, that does make sense. I'll confirm, but think we would need to ensure we don't set The issue actually manifested in that sometimes vite chunks depend on the entry already having been run (see nuxt/nuxt#18642 for example). Although that one was fixed, it feels better to evaluate the chunks in the order they expect to run. |
Thanks for explaining. Executing in order makes sense for vite indeed (webpack chunks in contrary self-register and evaluate in order by wp manifest) |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #46 +/- ##
==========================================
+ Coverage 95.23% 95.28% +0.04%
==========================================
Files 6 6
Lines 525 530 +5
Branches 114 115 +1
==========================================
+ Hits 500 505 +5
Misses 25 25
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
src/types.ts
Outdated
@@ -6,6 +6,7 @@ export interface ResourceMeta { | |||
assets?: string[] | |||
isEntry?: boolean | |||
isDynamicEntry?: boolean | |||
selfRegister?: boolean |
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.
Wdyt to rename to something like sideEffects: true
(because on any side-effect, order matters).
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.
nice idea
Currently we are adding
<script>
tags with dynamic entries, e.g. they export an entry. The only effect of this should be to run any side-effects. I think we should omit these and just add them to the link preloads. They will be imported from the entry-file instead.