fix: 修复vben/styles/global 全局注入的问题 (#4106)

https://doc.vben.pro/guide/essentials/styles.html#bem-%E8%A7%84%E8%8C%83

在widow下无法注册成功
This commit is contained in:
zmcode 2024-08-10 16:26:00 +08:00 committed by GitHub
parent 8725a01301
commit 6c117b4130
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import type { UserConfig } from 'vite';
import type { DefineApplicationOptions } from '../typing';
import { relative } from 'node:path';
import path, { relative } from 'node:path';
import { findMonorepoRoot } from '@vben/node-utils';
@ -101,7 +101,7 @@ function createCssOptions(injectGlobalScss = true) {
additionalData: (content: string, filepath: string) => {
const relativePath = relative(root, filepath);
// apps下的包注入全局样式
if (relativePath.startsWith('apps/')) {
if (relativePath.startsWith(`apps${path.sep}`)) {
return `@import "@vben/styles/global";\n${content}`;
}
return content;