@mandujs/core 0.20.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/bundler/css.ts +323 -353
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mandujs/core",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "Mandu Framework Core - Spec, Generator, Guard, Runtime",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,353 +1,323 @@
1
- /**
2
- * Mandu CSS Builder
3
- * Tailwind CSS v4 CLI 기반 CSS 빌드 및 감시
4
- *
5
- * 특징:
6
- * - Tailwind v4 Oxide Engine (Rust) 사용
7
- * - Zero Config: @import "tailwindcss" 자동 감지
8
- * - 출력: .mandu/client/globals.css
9
- */
10
-
11
- import { spawn, which, type Subprocess } from "bun";
12
- import path from "path";
13
- import fs from "fs/promises";
14
- import { watch as fsWatch, type FSWatcher } from "fs";
15
-
16
- /**
17
- * Tailwind CLI 실행 명령어를 결정한다.
18
- * bunx가 PATH에 없는 환경(일부 Windows/CI)에서도 동작하도록
19
- * `bun x`로 fallback한다.
20
- */
21
- function getTailwindCommand(args: string[]): string[] {
22
- if (which("bunx")) {
23
- return ["bunx", ...args];
24
- }
25
- // bunx shim이 없어도 `bun x`는 동작함
26
- return ["bun", "x", ...args];
27
- }
28
-
29
- // ========== Types ==========
30
-
31
- export interface CSSBuildOptions {
32
- /** 프로젝트 루트 디렉토리 */
33
- rootDir: string;
34
- /** CSS 입력 파일 (기본: "app/globals.css") */
35
- input?: string;
36
- /** CSS 출력 파일 (기본: ".mandu/client/globals.css") */
37
- output?: string;
38
- /** Watch 모드 활성화 */
39
- watch?: boolean;
40
- /** Minify 활성화 (production) */
41
- minify?: boolean;
42
- /** 빌드 완료 콜백 */
43
- onBuild?: (result: CSSBuildResult) => void;
44
- /** 에러 콜백 */
45
- onError?: (error: Error) => void;
46
- }
47
-
48
- export interface CSSBuildResult {
49
- success: boolean;
50
- outputPath: string;
51
- buildTime?: number;
52
- error?: string;
53
- }
54
-
55
- export interface CSSWatcher {
56
- /** Tailwind CLI 프로세스 */
57
- process: Subprocess;
58
- /** 출력 파일 경로 (절대 경로) */
59
- outputPath: string;
60
- /** 서버 경로 (/.mandu/client/globals.css) */
61
- serverPath: string;
62
- /** 프로세스 종료 */
63
- close: () => void;
64
- }
65
-
66
- // ========== Constants ==========
67
-
68
- const DEFAULT_INPUT = "app/globals.css";
69
- const DEFAULT_OUTPUT = ".mandu/client/globals.css";
70
- const SERVER_CSS_PATH = "/.mandu/client/globals.css";
71
-
72
- // ========== Detection ==========
73
-
74
- /**
75
- * Tailwind v4 프로젝트인지 감지
76
- * app/globals.css에 @import "tailwindcss" 포함 여부 확인
77
- */
78
- export async function isTailwindProject(rootDir: string): Promise<boolean> {
79
- const cssPath = path.join(rootDir, DEFAULT_INPUT);
80
-
81
- try {
82
- const content = await fs.readFile(cssPath, "utf-8");
83
- // Tailwind v4: @import "tailwindcss"
84
- // Tailwind v3: @tailwind base; @tailwind components; @tailwind utilities;
85
- return (
86
- content.includes('@import "tailwindcss"') ||
87
- content.includes("@import 'tailwindcss'") ||
88
- content.includes("@tailwind base")
89
- );
90
- } catch {
91
- return false;
92
- }
93
- }
94
-
95
- /**
96
- * CSS 입력 파일 존재 여부 확인
97
- */
98
- export async function hasCSSEntry(rootDir: string, input?: string): Promise<boolean> {
99
- const cssPath = path.join(rootDir, input || DEFAULT_INPUT);
100
- try {
101
- await fs.access(cssPath);
102
- return true;
103
- } catch {
104
- return false;
105
- }
106
- }
107
-
108
- // ========== Build ==========
109
-
110
- /**
111
- * CSS 일회성 빌드 (production용)
112
- */
113
- export async function buildCSS(options: CSSBuildOptions): Promise<CSSBuildResult> {
114
- const {
115
- rootDir,
116
- input = DEFAULT_INPUT,
117
- output = DEFAULT_OUTPUT,
118
- minify = true,
119
- } = options;
120
-
121
- const inputPath = path.join(rootDir, input);
122
- const outputPath = path.join(rootDir, output);
123
- const startTime = performance.now();
124
-
125
- // 출력 디렉토리 생성
126
- await fs.mkdir(path.dirname(outputPath), { recursive: true });
127
-
128
- // Tailwind CLI 실행
129
- const args = [
130
- "@tailwindcss/cli",
131
- "-i", inputPath,
132
- "-o", outputPath,
133
- ];
134
-
135
- if (minify) {
136
- args.push("--minify");
137
- }
138
-
139
- try {
140
- const proc = spawn(getTailwindCommand(args), {
141
- cwd: rootDir,
142
- stdout: "pipe",
143
- stderr: "pipe",
144
- });
145
-
146
- // 프로세스 완료 대기
147
- const exitCode = await proc.exited;
148
-
149
- if (exitCode !== 0) {
150
- const stderr = await new Response(proc.stderr).text();
151
- return {
152
- success: false,
153
- outputPath,
154
- error: stderr || `Tailwind CLI exited with code ${exitCode}`,
155
- };
156
- }
157
-
158
- const buildTime = performance.now() - startTime;
159
-
160
- return {
161
- success: true,
162
- outputPath,
163
- buildTime,
164
- };
165
- } catch (error) {
166
- return {
167
- success: false,
168
- outputPath,
169
- error: error instanceof Error ? error.message : String(error),
170
- };
171
- }
172
- }
173
-
174
- // ========== Watch ==========
175
-
176
- /**
177
- * CSS 감시 모드 시작 (development용)
178
- * Tailwind CLI --watch 모드로 실행
179
- */
180
- export async function startCSSWatch(options: CSSBuildOptions): Promise<CSSWatcher> {
181
- const {
182
- rootDir,
183
- input = DEFAULT_INPUT,
184
- output = DEFAULT_OUTPUT,
185
- minify = false,
186
- onBuild,
187
- onError,
188
- } = options;
189
-
190
- const inputPath = path.join(rootDir, input);
191
- const outputPath = path.join(rootDir, output);
192
-
193
- try {
194
- // 출력 디렉토리 생성
195
- await fs.mkdir(path.dirname(outputPath), { recursive: true });
196
- } catch (error) {
197
- const err = new Error(`CSS 출력 디렉토리 생성 실패: ${error instanceof Error ? error.message : error}`);
198
- console.error(`❌ ${err.message}`);
199
- onError?.(err);
200
- throw err;
201
- }
202
-
203
- // Tailwind CLI 인자 구성
204
- const args = [
205
- "@tailwindcss/cli",
206
- "-i", inputPath,
207
- "-o", outputPath,
208
- "--watch",
209
- ];
210
-
211
- if (minify) {
212
- args.push("--minify");
213
- }
214
-
215
- console.log(`🎨 Tailwind CSS v4 빌드 시작...`);
216
- console.log(` 입력: ${input}`);
217
- console.log(` 출력: ${output}`);
218
-
219
- // Bun subprocess로 Tailwind CLI 실행
220
- let proc;
221
- try {
222
- proc = spawn(getTailwindCommand(args), {
223
- cwd: rootDir,
224
- stdout: "pipe",
225
- stderr: "pipe",
226
- });
227
- } catch (error) {
228
- const err = new Error(
229
- `Tailwind CLI 실행 실패. @tailwindcss/cli가 설치되어 있는지 확인하세요.\n` +
230
- `설치: bun add -d @tailwindcss/cli tailwindcss\n` +
231
- `원인: ${error instanceof Error ? error.message : error}`
232
- );
233
- console.error(`❌ ${err.message}`);
234
- onError?.(err);
235
- throw err;
236
- }
237
-
238
- // 출력 파일 워처로 빌드 완료 감지 (stdout 패턴보다 신뢰성 높음, #111)
239
- // Tailwind CLI stdout 출력 형식은 버전마다 달라질 수 있으므로 파일 변경으로 감지
240
- let fsWatcher: FSWatcher | null = null;
241
- let lastMtime = 0;
242
-
243
- const startFileWatcher = () => {
244
- try {
245
- fsWatcher = fsWatch(outputPath, () => {
246
- // 연속 이벤트 중복 방지 (50ms 이내 재발생 무시)
247
- const now = Date.now();
248
- if (now - lastMtime < 50) return;
249
- lastMtime = now;
250
- console.log(` CSS rebuilt`);
251
- onBuild?.({ success: true, outputPath });
252
- });
253
- } catch {
254
- // 파일이 아직 없으면 500ms 재시도
255
- setTimeout(startFileWatcher, 500);
256
- }
257
- };
258
-
259
- // stdout 로그용 (빌드 시작/완료 메시지 표시)
260
- (async () => {
261
- const reader = proc.stdout.getReader();
262
- const decoder = new TextDecoder();
263
-
264
- while (true) {
265
- const { done, value } = await reader.read();
266
- if (done) break;
267
-
268
- const text = decoder.decode(value);
269
- const lines = text.split("\n").filter((l) => l.trim());
270
-
271
- for (const line of lines) {
272
- if (line.includes("warn") || line.includes("Warning")) {
273
- console.log(` ⚠️ CSS ${line.trim()}`);
274
- }
275
- }
276
- }
277
- })();
278
-
279
- // 초기 빌드 완료 후 파일 워처 시작
280
- startFileWatcher();
281
-
282
- // stderr 모니터링 (에러 감지)
283
- (async () => {
284
- const reader = proc.stderr.getReader();
285
- const decoder = new TextDecoder();
286
-
287
- while (true) {
288
- const { done, value } = await reader.read();
289
- if (done) break;
290
-
291
- const rawText = decoder.decode(value).trim();
292
- // ANSI 이스케이프 코드 제거 비교 (Tailwind CLI가 컬러 출력)
293
- const text = rawText.replace(/\u001b\[[0-9;]*m/g, "").trim();
294
- if (text) {
295
- // 환경 경고 무시
296
- if (text.includes(".bash_profile") || text.includes("$'\\377")) {
297
- continue;
298
- }
299
- // Tailwind CLI 정상 진행 메시지는 info 레벨로 처리
300
- // (패키지 해석, 다운로드, 잠금 파일 등은 정상 동작)
301
- if (
302
- text.includes("Resolving dependencies") ||
303
- text.includes("Resolved, downloaded") ||
304
- text.includes("Saved lockfile") ||
305
- text.includes("tailwindcss") ||
306
- text.match(/^v?\d+\.\d+\.\d+/) // 버전 출력
307
- ) {
308
- if (text) console.log(` ℹ️ CSS: ${text}`);
309
- continue;
310
- }
311
- console.error(` ❌ CSS Error: ${text}`);
312
- onError?.(new Error(text));
313
- }
314
- }
315
- })();
316
-
317
- // 프로세스 종료 감지
318
- proc.exited.then((code) => {
319
- if (code !== 0 && code !== null) {
320
- console.error(` ❌ Tailwind CLI exited with code ${code}`);
321
- }
322
- });
323
-
324
- return {
325
- process: proc,
326
- outputPath,
327
- serverPath: SERVER_CSS_PATH,
328
- close: () => {
329
- fsWatcher?.close();
330
- // Windows에서는 SIGTERM이 무시될 수 있으므로 SIGKILL 사용 (#117)
331
- if (process.platform === "win32") {
332
- proc.kill("SIGKILL");
333
- } else {
334
- proc.kill();
335
- }
336
- },
337
- };
338
- }
339
-
340
- /**
341
- * CSS 서버 경로 반환
342
- */
343
- export function getCSSServerPath(): string {
344
- return SERVER_CSS_PATH;
345
- }
346
-
347
- /**
348
- * CSS 링크 태그 생성
349
- */
350
- export function generateCSSLinkTag(isDev: boolean = false): string {
351
- const cacheBust = isDev ? `?t=${Date.now()}` : "";
352
- return `<link rel="stylesheet" href="${SERVER_CSS_PATH}${cacheBust}">`;
353
- }
1
+ /**
2
+ * Mandu CSS Builder
3
+ * Tailwind CSS v4 CLI 기반 CSS 빌드 및 감시
4
+ *
5
+ * 특징:
6
+ * - Tailwind v4 Oxide Engine (Rust) 사용
7
+ * - Zero Config: @import "tailwindcss" 자동 감지
8
+ * - 출력: .mandu/client/globals.css
9
+ *
10
+ * #152: Tailwind CLI --watch 모드가 Bun.spawn에서 hang되는 문제 수정
11
+ * - 원인: @tailwindcss/cli v4 --watch 모드가 Bun subprocess에서 파일 미생성
12
+ * - 해결: 자체 파일 감시 + 단발 빌드 반복 방식으로 전환
13
+ */
14
+
15
+ import { spawn } from "bun";
16
+ import path from "path";
17
+ import fs from "fs/promises";
18
+ import { watch as fsWatch, type FSWatcher } from "fs";
19
+
20
+ /**
21
+ * Tailwind CLI 실행 명령어를 결정한다.
22
+ * Windows에서 Bun.spawn은 PATH 기반 명령어 해석이 불안정하므로 (#152)
23
+ * process.execPath (절대 경로)를 사용해 안정적으로 실행한다.
24
+ */
25
+ function getTailwindCommand(args: string[]): string[] {
26
+ return [process.execPath, "x", ...args];
27
+ }
28
+
29
+ // ========== Types ==========
30
+
31
+ export interface CSSBuildOptions {
32
+ /** 프로젝트 루트 디렉토리 */
33
+ rootDir: string;
34
+ /** CSS 입력 파일 (기본: "app/globals.css") */
35
+ input?: string;
36
+ /** CSS 출력 파일 (기본: ".mandu/client/globals.css") */
37
+ output?: string;
38
+ /** Watch 모드 활성화 */
39
+ watch?: boolean;
40
+ /** Minify 활성화 (production) */
41
+ minify?: boolean;
42
+ /** 빌드 완료 콜백 */
43
+ onBuild?: (result: CSSBuildResult) => void;
44
+ /** 에러 콜백 */
45
+ onError?: (error: Error) => void;
46
+ }
47
+
48
+ export interface CSSBuildResult {
49
+ success: boolean;
50
+ outputPath: string;
51
+ buildTime?: number;
52
+ error?: string;
53
+ }
54
+
55
+ export interface CSSWatcher {
56
+ /** 출력 파일 경로 (절대 경로) */
57
+ outputPath: string;
58
+ /** 서버 경로 (/.mandu/client/globals.css) */
59
+ serverPath: string;
60
+ /** 감시 중지 */
61
+ close: () => void;
62
+ }
63
+
64
+ // ========== Constants ==========
65
+
66
+ const DEFAULT_INPUT = "app/globals.css";
67
+ const DEFAULT_OUTPUT = ".mandu/client/globals.css";
68
+ const SERVER_CSS_PATH = "/.mandu/client/globals.css";
69
+ const CSS_REBUILD_DEBOUNCE = 150; // ms
70
+
71
+ // ========== Detection ==========
72
+
73
+ /**
74
+ * Tailwind v4 프로젝트인지 감지
75
+ * app/globals.css에 @import "tailwindcss" 포함 여부 확인
76
+ */
77
+ export async function isTailwindProject(rootDir: string): Promise<boolean> {
78
+ const cssPath = path.join(rootDir, DEFAULT_INPUT);
79
+
80
+ try {
81
+ const content = await fs.readFile(cssPath, "utf-8");
82
+ return (
83
+ content.includes('@import "tailwindcss"') ||
84
+ content.includes("@import 'tailwindcss'") ||
85
+ content.includes("@tailwind base")
86
+ );
87
+ } catch {
88
+ return false;
89
+ }
90
+ }
91
+
92
+ /**
93
+ * CSS 입력 파일 존재 여부 확인
94
+ */
95
+ export async function hasCSSEntry(rootDir: string, input?: string): Promise<boolean> {
96
+ const cssPath = path.join(rootDir, input || DEFAULT_INPUT);
97
+ try {
98
+ await fs.access(cssPath);
99
+ return true;
100
+ } catch {
101
+ return false;
102
+ }
103
+ }
104
+
105
+ // ========== Build ==========
106
+
107
+ /**
108
+ * CSS 단발 빌드 (--watch 없이)
109
+ * Tailwind CLI --watch가 Bun.spawn에서 hang되므로 (#152) 단발 빌드만 사용
110
+ */
111
+ async function runCSSBuild(
112
+ rootDir: string,
113
+ inputPath: string,
114
+ outputPath: string,
115
+ minify: boolean,
116
+ ): Promise<CSSBuildResult> {
117
+ const startTime = performance.now();
118
+ const args = ["@tailwindcss/cli", "-i", inputPath, "-o", outputPath];
119
+ if (minify) args.push("--minify");
120
+
121
+ try {
122
+ const proc = spawn(getTailwindCommand(args), {
123
+ cwd: rootDir,
124
+ stdout: "pipe",
125
+ stderr: "pipe",
126
+ });
127
+
128
+ const exitCode = await proc.exited;
129
+
130
+ if (exitCode !== 0) {
131
+ const rawStderr = await new Response(proc.stderr).text();
132
+ // ANSI escape + 환경 경고 필터링
133
+ const stderr = rawStderr
134
+ .replace(/\u001b\[[0-9;]*m/g, "")
135
+ .split("\n")
136
+ .filter((l) => l.trim() && !l.includes(".bash_profile") && !l.includes("$'\\377"))
137
+ .join("\n")
138
+ .trim();
139
+ return {
140
+ success: false,
141
+ outputPath,
142
+ error: stderr || `Tailwind CLI exited with code ${exitCode}`,
143
+ };
144
+ }
145
+
146
+ return {
147
+ success: true,
148
+ outputPath,
149
+ buildTime: performance.now() - startTime,
150
+ };
151
+ } catch (error) {
152
+ return {
153
+ success: false,
154
+ outputPath,
155
+ error: error instanceof Error ? error.message : String(error),
156
+ };
157
+ }
158
+ }
159
+
160
+ /**
161
+ * CSS 일회성 빌드 (production용)
162
+ */
163
+ export async function buildCSS(options: CSSBuildOptions): Promise<CSSBuildResult> {
164
+ const {
165
+ rootDir,
166
+ input = DEFAULT_INPUT,
167
+ output = DEFAULT_OUTPUT,
168
+ minify = true,
169
+ } = options;
170
+
171
+ const inputPath = path.join(rootDir, input);
172
+ const outputPath = path.join(rootDir, output);
173
+
174
+ await fs.mkdir(path.dirname(outputPath), { recursive: true });
175
+ return runCSSBuild(rootDir, inputPath, outputPath, minify);
176
+ }
177
+
178
+ // ========== Watch ==========
179
+
180
+ /**
181
+ * CSS 감시 모드 시작 (development용)
182
+ *
183
+ * #152: Tailwind CLI --watch 모드가 Bun.spawn에서 파일을 생성하지 않는 문제로 인해
184
+ * 자체 파일 감시 + 단발 빌드 반복 방식을 사용한다.
185
+ *
186
+ * 동작:
187
+ * 1. 초기 단발 빌드 실행 (await — 서버 시작 전 CSS 준비 보장)
188
+ * 2. app/, src/ 디렉토리 및 입력 CSS 파일 감시
189
+ * 3. 관련 파일 변경 시 debounce 후 단발 빌드 재실행
190
+ */
191
+ export async function startCSSWatch(options: CSSBuildOptions): Promise<CSSWatcher> {
192
+ const {
193
+ rootDir,
194
+ input = DEFAULT_INPUT,
195
+ output = DEFAULT_OUTPUT,
196
+ minify = false,
197
+ onBuild,
198
+ onError,
199
+ } = options;
200
+
201
+ const inputPath = path.join(rootDir, input);
202
+ const outputPath = path.join(rootDir, output);
203
+
204
+ // 출력 디렉토리 생성
205
+ try {
206
+ await fs.mkdir(path.dirname(outputPath), { recursive: true });
207
+ } catch (error) {
208
+ const err = new Error(`CSS 출력 디렉토리 생성 실패: ${error instanceof Error ? error.message : error}`);
209
+ console.error(`❌ ${err.message}`);
210
+ onError?.(err);
211
+ throw err;
212
+ }
213
+
214
+ console.log(`🎨 Tailwind CSS v4 빌드 시작...`);
215
+ console.log(` 입력: ${input}`);
216
+ console.log(` 출력: ${output}`);
217
+
218
+ // 1. 초기 빌드 (await — 서버 시작 전 CSS 준비 보장)
219
+ const initialResult = await runCSSBuild(rootDir, inputPath, outputPath, minify);
220
+
221
+ if (initialResult.success) {
222
+ console.log(` ✅ CSS built (${Math.round(initialResult.buildTime ?? 0)}ms)`);
223
+ } else {
224
+ console.error(` ❌ CSS build failed: ${initialResult.error}`);
225
+ onError?.(new Error(initialResult.error));
226
+ }
227
+
228
+ // 2. 파일 감시 설정 (CSS 소스, app/, src/ 디렉토리)
229
+ const watchers: FSWatcher[] = [];
230
+ let debounceTimer: ReturnType<typeof setTimeout> | null = null;
231
+ let isBuilding = false;
232
+ let pendingRebuild = false;
233
+
234
+ const triggerRebuild = () => {
235
+ if (debounceTimer) clearTimeout(debounceTimer);
236
+
237
+ debounceTimer = setTimeout(async () => {
238
+ if (isBuilding) {
239
+ pendingRebuild = true;
240
+ return;
241
+ }
242
+
243
+ isBuilding = true;
244
+ try {
245
+ const result = await runCSSBuild(rootDir, inputPath, outputPath, minify);
246
+ if (result.success) {
247
+ console.log(` ✅ CSS rebuilt (${Math.round(result.buildTime ?? 0)}ms)`);
248
+ onBuild?.(result);
249
+ } else {
250
+ console.error(` CSS rebuild failed: ${result.error}`);
251
+ onError?.(new Error(result.error));
252
+ }
253
+ } catch (err) {
254
+ const error = err instanceof Error ? err : new Error(String(err));
255
+ console.error(` ❌ CSS rebuild error: ${error.message}`);
256
+ onError?.(error);
257
+ } finally {
258
+ isBuilding = false;
259
+ if (pendingRebuild) {
260
+ pendingRebuild = false;
261
+ triggerRebuild();
262
+ }
263
+ }
264
+ }, CSS_REBUILD_DEBOUNCE);
265
+ };
266
+
267
+ // CSS/TSX/HTML 파일 변경 시 리빌드 트리거
268
+ const isRelevantChange = (filename: string | null): boolean => {
269
+ if (!filename) return false;
270
+ const ext = path.extname(filename).toLowerCase();
271
+ return [".css", ".tsx", ".ts", ".jsx", ".js", ".html"].includes(ext);
272
+ };
273
+
274
+ // 감시 대상 디렉토리
275
+ const watchTargets = ["app", "src"];
276
+
277
+ for (const dir of watchTargets) {
278
+ const absDir = path.join(rootDir, dir);
279
+ try {
280
+ await fs.access(absDir);
281
+ const watcher = fsWatch(absDir, { recursive: true }, (_event, filename) => {
282
+ if (isRelevantChange(filename)) {
283
+ triggerRebuild();
284
+ }
285
+ });
286
+ watchers.push(watcher);
287
+ } catch {
288
+ // 디렉토리 없으면 무시
289
+ }
290
+ }
291
+
292
+ // 입력 CSS 파일 직접 감시 (app/ 외부에 있을 수도 있으므로)
293
+ try {
294
+ const cssWatcher = fsWatch(inputPath, () => triggerRebuild());
295
+ watchers.push(cssWatcher);
296
+ } catch {
297
+ // 무시
298
+ }
299
+
300
+ return {
301
+ outputPath,
302
+ serverPath: SERVER_CSS_PATH,
303
+ close: () => {
304
+ if (debounceTimer) clearTimeout(debounceTimer);
305
+ for (const w of watchers) w.close();
306
+ },
307
+ };
308
+ }
309
+
310
+ /**
311
+ * CSS 서버 경로 반환
312
+ */
313
+ export function getCSSServerPath(): string {
314
+ return SERVER_CSS_PATH;
315
+ }
316
+
317
+ /**
318
+ * CSS 링크 태그 생성
319
+ */
320
+ export function generateCSSLinkTag(isDev: boolean = false): string {
321
+ const cacheBust = isDev ? `?t=${Date.now()}` : "";
322
+ return `<link rel="stylesheet" href="${SERVER_CSS_PATH}${cacheBust}">`;
323
+ }