Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59d0b35

Browse files
authored
perf(css): avoid constructingrenderedModules (#19775)
1 parent175a839 commit59d0b35

File tree

1 file changed

+13
-4
lines changed
  • packages/vite/src/node/plugins

1 file changed

+13
-4
lines changed

‎packages/vite/src/node/plugins/css.ts‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,10 +640,19 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
640640

641641
asyncrenderChunk(code,chunk,opts,meta){
642642
letchunkCSS=''
643-
constrenderedModules=Object.fromEntries(
644-
Object.values(meta.chunks).flatMap((chunk)=>
645-
Object.entries(chunk.modules),
646-
),
643+
constrenderedModules=newProxy(
644+
{}asRecord<string,RenderedModule|undefined>,
645+
{
646+
get(_target,p){
647+
for(constnameinmeta.chunks){
648+
constmodules=meta.chunks[name].modules
649+
constmodule=modules[passtring]
650+
if(module){
651+
returnmodule
652+
}
653+
}
654+
},
655+
},
647656
)
648657
// the chunk is empty if it's a dynamic entry chunk that only contains a CSS import
649658
constisJsChunkEmpty=code===''&&!chunk.isEntry

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp