feat: unocss + vite config
This commit is contained in:
parent
3ba37d9b05
commit
61f3b4f1ee
@ -25,8 +25,15 @@ export default defineConfig({
|
||||
},
|
||||
}),
|
||||
],
|
||||
/**
|
||||
* 自定义快捷语句
|
||||
* @see https://github.com/unocss/unocss#shortcuts
|
||||
*/
|
||||
shortcuts: [['center', 'flex justify-center items-center']],
|
||||
transformers: [
|
||||
// 启用 @apply 功能
|
||||
transformerDirectives(),
|
||||
// 启用 () 分组功能
|
||||
// 支持css class组合,eg: `<div class="hover:(bg-gray-400 font-medium) font-(light mono)">测试 unocss</div>`
|
||||
transformerVariantGroup(),
|
||||
],
|
||||
|
@ -130,6 +130,7 @@ export default ({ command, mode }) => {
|
||||
// },
|
||||
// }),
|
||||
],
|
||||
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: [
|
||||
@ -150,15 +151,6 @@ export default ({ command, mode }) => {
|
||||
host: '0.0.0.0',
|
||||
hmr: true,
|
||||
port: Number.parseInt(env.VITE_APP_PORT, 10),
|
||||
// 自定义代理规则
|
||||
proxy: {
|
||||
// 选项写法
|
||||
'/api': {
|
||||
target: 'http://localhost:6666',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
minify: 'terser',
|
||||
|
Loading…
x
Reference in New Issue
Block a user