This commit is contained in:
hezhidong
2025-04-23 17:19:04 +08:00
parent 0fb61604d5
commit e1d13a3aeb
7 changed files with 557 additions and 555 deletions
+12 -16
View File
@@ -1,9 +1,8 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from "path"
import styleImport, { VantResolve } from 'vite-plugin-style-import';
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import styleImport, { VantResolve } from "vite-plugin-style-import";
// https://vitejs.dev/config/
export default defineConfig({
@@ -13,19 +12,17 @@ export default defineConfig({
resolves: [VantResolve()],
libs: [
{
libraryName: 'vant',
libraryName: "vant",
esModule: true,
resolveStyle: (name) => `../es/${name}/style`, //https://blog.csdn.net/yunchong_zhao/article/details/123552423
},
],
}),
],
server: {
host: '0.0.0.0',//设置地址:http://localhost
host: "0.0.0.0", //设置地址:http://localhost
port: 4000, // 设置服务启动端口号
hmr: false, // 关闭热更新
// open: true, // 设置服务启动时是否自动打开浏览器
// cors: true, // 允许跨域
// proxy: {
@@ -38,10 +35,10 @@ export default defineConfig({
// }
// }
},
resolve:{
alias:{
"@": resolve(__dirname, "src")
}
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
css: {
// css预处理器
@@ -52,5 +49,4 @@ export default defineConfig({
},
},
},
})
});