【build】multi html inputs with same entry might cause missing css in the first html #13829
Closed
7 tasks done
Labels
duplicate
This issue or pull request already exists
Describe the bug
my project are built with multi inputs with different html but he same entrys.
like :
us.html -> main.tsx -> App.tsx
jp.html-> main.tsx -> App.tsx
cn.html -> main.tsx -> App.tsx
App.ts-> Left.tsx-> LeftLazy.tsx
App.ts-> Left.tsx->LeftNotLazy.tsx
App.ts-> Right.tsx-> RightLazy.tsx
App.ts-> Right.tsx->RightNotLazy.tsx
test.html -> Right.tsx .
I found it occurs to happen when build with vite , jp.html and cn.html are always good,but us.html sometimes missing css.
I expect
us.html
jp.html
cn.html
they always have the same sequence of js and css list.
Reproduction
https://stackblitz.com/edit/vitejs-vite-dpuudd?file=patches%2Fvite%2B4.3.9.patch,src%2Fmain1.tsx,src%2Fmain.tsx,src%2FLeft1.tsx,index.html,vite.config.ts,src%2FApp.tsx,src%2FRight.tsx
Steps to reproduce
yarn install and yarn build.
I found that in the 'vite:build-html' plugin,It will deals with the processedHtml,the processedHtml comes from build inputs ,and if the build inputs depends on the same entry.It will generate the same chunk named after the first input name like /assets/en-us-a5167a8d.js
which will be marked as canInlineEntry=false
And the css import by the chunk will be add up to the html.
if the us.html or the canInlineEntry are not set as the first place in the processedHtml,the bug will occur and the us.html will miss the css list.
to make the bug 100% occurs I patch the vite+4.3.9 just to let the first entry placing in the end of processedHtml
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: