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

Commit 1f92bc4

Browse files
committed
fix(build-in): Fixing order guarantee
1 parent c92a5ab commit 1f92bc4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/_internal/utils/build-in.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use server';
2-
import { isServer } from './helper';
32

3+
import { isServer } from './helper';
44
export const buildIn = (styleSheet: string, global?: string): void => {
55
if (!isServer) return;
66

@@ -10,13 +10,9 @@ export const buildIn = (styleSheet: string, global?: string): void => {
1010
const globalFilePath = path.join(__dirname, '../../core/styles/global.css');
1111
const filePath = global === '--global' ? globalFilePath : styleFilePath;
1212
const message = global === '--global' ? ' ✅ Generating global static css \n' : ' ✅ Generating module static css \n';
13-
1413
try {
1514
if (fs.existsSync(filePath)) {
16-
const cssData = fs.readFileSync(filePath, 'utf-8');
17-
if (!cssData.includes(styleSheet)) {
18-
fs.appendFileSync(filePath, styleSheet, 'utf-8');
19-
}
15+
fs.appendFileSync(filePath, styleSheet, 'utf-8');
2016
if (process.argv.includes('--log')) console.log(message + styleSheet);
2117
}
2218
} catch (error) {

0 commit comments

Comments
 (0)