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

Commit c6cc087

Browse files
committed
fix(build-in.ts): set fs and path to server side only
1 parent d95e860 commit c6cc087

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/_internal/utils/build-in.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
'use server';
2-
3-
import * as fs from 'fs';
4-
import * as path from 'path';
52
import { isServer } from './helper';
63

7-
export const buildIn = async (styleSheet: string, global?: string): Promise<void> => {
4+
export const buildIn = (styleSheet: string, global?: string): void => {
5+
if (!isServer) return;
6+
7+
const fs = require('fs');
8+
const path = require('path');
89
const styleFilePath = path.join(__dirname, '../../core/styles/style.module.css');
910
const globalFilePath = path.join(__dirname, '../../core/styles/global.css');
10-
1111
const filePath = global === '--global' ? globalFilePath : styleFilePath;
1212
const message = global === '--global' ? ' ✅ Generating global static css \n' : ' ✅ Generating module static css \n';
1313

14-
if (!isServer) return;
1514
try {
1615
if (fs.existsSync(filePath)) {
1716
const cssData = fs.readFileSync(filePath, 'utf-8');

0 commit comments

Comments
 (0)