why no modulepreload
flag appear in html?
#19857
Unanswered
webjohnjiang
asked this question in
Q&A
Replies: 1 comment 2 replies
-
It's because there's no files that matches the condition written in the document: "entry chunks and their direct imports". Dynamic import does not create an entry chunk. It creates an dynamic entry chunk instead.
That would cause "common chunk C" to be loaded even when "async chunk A" and "async chunks B" are not imported, and block the other network requests. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Documentation is
Explain in Detail
question 1:
the document display "加载指令生成
Vite 会为入口 chunk 和它们在打包出的 HTML 中的直接引入自动生成 指令。"。
When i create a vite vue app, and use dymanic import in my main.js,but no preload cmd appear in dist/html。
this is the dist/index.html:
question 2:
The document mentions "Vite 将使用一个预加载步骤自动重写代码,来分割动态导入调用,以实现当 A 被请求时,C 也将 同时 被请求:"。
这里为什么不采用像webpack之类的方案:直接把这个common-chunk提前放置到html里面前方位置。这样当A执行时,C已经提前ready准备好了?
Your Suggestion for Changes
delete the preloadmodule section?
Reproduction
No response
Steps to reproduce
No response
Beta Was this translation helpful? Give feedback.
All reactions