Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 1260424

Browse files
committed
perf(compiler): node.js fastest recommended
1 parent 6b164d9 commit 1260424

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

compiler/src/index.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,19 @@ async function getAppRoot(): Promise<string> {
3535
const files = await globby([path.join(appRoot, '**/*.{ts,tsx}')]);
3636
const styleFiles = files.filter(isCSSX);
3737
console.log('\n💬 The following CSS caches were accepted:\n');
38+
const importPromises = styleFiles.map(styleFile => import(path.resolve(styleFile)));
39+
await Promise.all(importPromises);
40+
41+
for (let i = 0; i < styleFiles.length; i++) {
42+
await createBuildIn();
43+
}
44+
for (let i = 0; i < styleFiles.length; i++) {
45+
await setBuildIn();
46+
}
47+
for (let i = 0; i < styleFiles.length; i++) {
48+
await globalBuildIn();
49+
}
3850
for (let i = 0; i < styleFiles.length; i++) {
39-
await import(path.resolve(styleFiles[i]));
40-
createBuildIn();
41-
setBuildIn();
42-
globalBuildIn();
43-
rootBuildIn();
51+
await rootBuildIn();
4452
}
4553
})();

0 commit comments

Comments
 (0)