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: [
|
transformers: [
|
||||||
|
// 启用 @apply 功能
|
||||||
transformerDirectives(),
|
transformerDirectives(),
|
||||||
|
// 启用 () 分组功能
|
||||||
// 支持css class组合,eg: `<div class="hover:(bg-gray-400 font-medium) font-(light mono)">测试 unocss</div>`
|
// 支持css class组合,eg: `<div class="hover:(bg-gray-400 font-medium) font-(light mono)">测试 unocss</div>`
|
||||||
transformerVariantGroup(),
|
transformerVariantGroup(),
|
||||||
],
|
],
|
||||||
|
@ -130,6 +130,7 @@ export default ({ command, mode }) => {
|
|||||||
// },
|
// },
|
||||||
// }),
|
// }),
|
||||||
],
|
],
|
||||||
|
|
||||||
css: {
|
css: {
|
||||||
postcss: {
|
postcss: {
|
||||||
plugins: [
|
plugins: [
|
||||||
@ -150,15 +151,6 @@ export default ({ command, mode }) => {
|
|||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
hmr: true,
|
hmr: true,
|
||||||
port: Number.parseInt(env.VITE_APP_PORT, 10),
|
port: Number.parseInt(env.VITE_APP_PORT, 10),
|
||||||
// 自定义代理规则
|
|
||||||
proxy: {
|
|
||||||
// 选项写法
|
|
||||||
'/api': {
|
|
||||||
target: 'http://localhost:6666',
|
|
||||||
changeOrigin: true,
|
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
minify: 'terser',
|
minify: 'terser',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user