Skip to content

Commit e38a891

Browse files
committed
refactor: 移除未使用的 playground 模块,精简项目结构
- 删除 playground 目录及其所有相关文件 - 移除 package.json 中的 build:play 和 dev:play 脚本 - 更新 pnpm-workspace.yaml,移除 playground 工作区引用 - 更新 Dockerfile,将构建产物路径改为对应的 web 应用 dist - 更新 vben-admin.code-workspace,移除 playground 工作区配置 - 修复 tailwind/postcss 构建错误并支持 top-level await
1 parent ee74caf commit e38a891

File tree

196 files changed

+55
-14544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+55
-14544
lines changed

apps/web-naive/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@
4545
"pinia": "catalog:",
4646
"vue": "catalog:",
4747
"vue-router": "catalog:"
48+
},
49+
"devDependencies": {
50+
"cssnano": "catalog:"
4851
}
4952
}

apps/web-naive/postcss.config.mjs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
export { default } from '@vben/tailwind-config/postcss';
1+
import config from '@vben/tailwind-config';
2+
import cssnano from 'cssnano';
3+
4+
export default {
5+
plugins: {
6+
...(process.env.NODE_ENV === 'production' ? { cssnano } : {}),
7+
autoprefixer: {},
8+
'postcss-antd-fixes': { prefixes: ['ant', 'el'] },
9+
'postcss-import': {},
10+
'postcss-preset-env': {},
11+
tailwindcss: { config },
12+
'tailwindcss/nesting': {},
13+
},
14+
};

apps/web-naive/vite.config.mts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
11
import { defineConfig } from '@vben/vite-config';
2+
import path from 'node:path';
23

34
export default defineConfig(async () => {
45
return {
56
application: {},
67
vite: {
8+
resolve: {
9+
alias: {
10+
'@vben/tailwind-config': path.resolve(__dirname, '../../internal/tailwind-config/src/index.ts'),
11+
},
12+
},
13+
optimizeDeps: {
14+
exclude: ['jiti'],
15+
},
16+
ssr: {
17+
noExternal: [],
18+
external: ['jiti'],
19+
},
20+
build: {
21+
target: 'es2022',
22+
commonjsOptions: {
23+
transformMixedEsModules: true,
24+
},
25+
rollupOptions: {
26+
external: (id) => {
27+
// Exclude jiti and related Node.js modules from build
28+
if (id.includes('jiti') || id.startsWith('node:')) {
29+
return true;
30+
}
31+
return false;
32+
},
33+
},
34+
},
735
server: {
836
proxy: {
937
'/api': {

internal/tailwind-config/src/postcss.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import config from '.';
2+
import cssnano from 'cssnano';
23

34
export default {
45
plugins: {
5-
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}),
6+
...(process.env.NODE_ENV === 'production' ? { cssnano } : {}),
67
// Specifying the config is not necessary in most cases, but it is included
78
autoprefixer: {},
89
// 修复 element-plus 和 ant-design-vue 的样式和tailwindcss冲突问题

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"build:docker": "./scripts/deploy/build-local-docker-image.sh",
3131
"build:docs": "pnpm run build --filter=@vben/docs",
3232
"build:naive": "pnpm run build --filter=@vben/web-naive",
33-
"build:play": "pnpm run build --filter=@vben/playground",
3433
"changeset": "pnpm exec changeset",
3534
"check": "pnpm run check:circular && pnpm run check:dep && pnpm run check:type && pnpm check:cspell",
3635
"check:circular": "vsh check-circular",
@@ -42,7 +41,6 @@
4241
"dev": "turbo-run dev",
4342
"dev:docs": "pnpm -F @vben/docs run dev",
4443
"dev:naive": "pnpm -F @vben/web-naive run dev",
45-
"dev:play": "pnpm -F @vben/playground run dev",
4644
"format": "vsh lint --format",
4745
"lint": "vsh lint",
4846
"postinstall": "pnpm -r run stub --if-present",

playground/.env

Lines changed: 0 additions & 8 deletions
This file was deleted.

playground/.env.analyze

Lines changed: 0 additions & 7 deletions
This file was deleted.

playground/.env.development

Lines changed: 0 additions & 20 deletions
This file was deleted.

playground/.env.production

Lines changed: 0 additions & 19 deletions
This file was deleted.

playground/__tests__/e2e/auth-login.spec.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)