47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import Components from 'unplugin-vue-components/vite'
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
import { VantResolver } from 'unplugin-vue-components/resolvers'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
export default defineConfig({
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 9992,
|
|
// 是否开启 https
|
|
https: false,
|
|
},
|
|
plugins: [
|
|
vue(
|
|
{
|
|
template: {
|
|
compilerOptions: {
|
|
// 忽略wx-open-launch 开头的组件,这些是微信的默认组件
|
|
isCustomElement: (tag) => tag.includes('wx-open-launch')
|
|
}
|
|
}
|
|
}
|
|
),
|
|
Components({
|
|
resolvers: [VantResolver()],
|
|
}),
|
|
AutoImport({
|
|
imports: ['vue', 'vue-router'],
|
|
resolvers: [VantResolver()],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
javascriptEnabled: true,
|
|
},
|
|
},
|
|
},
|
|
})
|