Skip to content

Commit 9431941

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 b42006b commit 9431941

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-antd/package.json

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

apps/web-antd/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-antd/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
@@ -33,7 +33,6 @@
3333
"build:antd": "pnpm run build --filter=@vben/web-antd",
3434
"build:docker": "./scripts/deploy/build-local-docker-image.sh",
3535
"build:docs": "pnpm run build --filter=@vben/docs",
36-
"build:play": "pnpm run build --filter=@vben/playground",
3736
"changeset": "pnpm exec changeset",
3837
"check": "pnpm run check:circular && pnpm run check:dep && pnpm run check:type && pnpm check:cspell",
3938
"check:circular": "vsh check-circular",
@@ -45,7 +44,6 @@
4544
"dev": "turbo-run dev",
4645
"dev:antd": "pnpm -F @vben/web-antd run dev",
4746
"dev:docs": "pnpm -F @vben/docs run dev",
48-
"dev:play": "pnpm -F @vben/playground run dev",
4947
"format": "vsh lint --format",
5048
"lint": "vsh lint",
5149
"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)