Skip to content

Commit

Permalink
feat(projects): 引入unocss替换windicss
Browse files Browse the repository at this point in the history
  • Loading branch information
Soybean committed Apr 22, 2022
1 parent 5e27642 commit c9d3e5a
Show file tree
Hide file tree
Showing 14 changed files with 1,108 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Expand Up @@ -31,6 +31,6 @@
"johnsoncodehk.vscode-typescript-vue-plugin",
"dariofuzinato.vue-peek",
"wscats.vue",
"voorjaar.windicss-intellisense"
"antfu.unocss"
]
}
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -51,7 +51,7 @@ Soybean Admin 是一个基于 Vue3、Vite、TypeScript、Naive UI 的免费中
## 开发计划

- [x] 添加前端静态路由
- [ ] 集成unocss替换windicss(新分支unocss)
- [x] 集成unocss替换windicss(新分支unocss)
- [ ] 用户角色切换示例、按钮级别权限指令
- [ ] 最近功能的有关文档更新
- [ ] 引入ECharts替换AntV G2Plot
Expand Down
5 changes: 3 additions & 2 deletions build/plugins/index.ts
@@ -1,8 +1,9 @@
import type { ConfigEnv, PluginOption } from 'vite';
import vue from './vue';
import vueJsx from './jsx';
import html from './html';
import autoImport from './auto-import';
import windicss from './windicss';
import unocss from './unocss';
import mock from './mock';
import visualizer from './visualizer';

Expand All @@ -17,7 +18,7 @@ export function setupVitePlugins(
srcPath: string,
viteEnv: ImportMetaEnv
): (PluginOption | PluginOption[])[] {
const plugins = [vue, html(configEnv), ...autoImport(srcPath), windicss, mock];
const plugins = [vue, vueJsx, html(configEnv), ...autoImport(srcPath), unocss, mock];

if (configEnv.command === 'build' && viteEnv.VITE_VISUALIZER === 'true') {
plugins.push(visualizer);
Expand Down
3 changes: 3 additions & 0 deletions build/plugins/jsx.ts
@@ -0,0 +1,3 @@
import vueJsx from '@vitejs/plugin-vue-jsx';

export default vueJsx();
3 changes: 3 additions & 0 deletions build/plugins/unocss.ts
@@ -0,0 +1,3 @@
import unocss from 'unocss/vite';

export default unocss();
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -64,6 +64,7 @@
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"@vitejs/plugin-vue": "^2.3.1",
"@vitejs/plugin-vue-jsx": "^1.3.10",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^10.0.0",
"@vue/tsconfig": "^0.1.3",
Expand All @@ -86,6 +87,7 @@
"rollup-plugin-visualizer": "^5.6.0",
"sass": "^1.50.1",
"typescript": "^4.6.3",
"unocss": "^0.31.12",
"unplugin-icons": "^0.14.1",
"unplugin-vue-components": "0.18.5",
"vite": "^2.9.5",
Expand All @@ -94,7 +96,6 @@
"vite-plugin-mock": "^2.9.6",
"vite-plugin-windicss": "^1.8.4",
"vue-tsc": "^0.34.9",
"vueuc": "^0.4.32",
"windicss": "^3.5.1"
"vueuc": "^0.4.32"
}
}

0 comments on commit c9d3e5a

Please sign in to comment.