提交 ff1b294a authored 作者: Administrator's avatar Administrator

更新

上级 8bf351b9
import { defineConfig } from 'vite'; import { defineConfig } from "vite";
// import pxtovw from 'postcss-px-to-viewport' // import pxtovw from 'postcss-px-to-viewport'
import { resolve } from 'path'; import { resolve } from "path";
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'; import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
import uni from '@dcloudio/vite-plugin-uni'; import uni from "@dcloudio/vite-plugin-uni";
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
uni(), uni(),
createSvgIconsPlugin({ createSvgIconsPlugin({
iconDirs: [resolve(process.cwd(), 'src/static/svg')], iconDirs: [resolve(process.cwd(), "src/static/svg")],
symbolId: 'icon-[dir]-[name]', symbolId: "icon-[dir]-[name]",
}), }),
], ],
resolve: { resolve: {
alias: { alias: {
'@': resolve(__dirname, './src'), "@": resolve(__dirname, "./src"),
},
}, },
css: { },
preprocessorOptions: { css: {
scss: { preprocessorOptions: {
additionalData: `@import "@/uni.scss";`, scss: {
}, additionalData: `@import "@/uni.scss";`,
}, },
postcss: {
// plugins: [loder_pxtovw]
},
}, },
assetsInclude: '@dcloudio/uni-ui', postcss: {
build: { // plugins: [loder_pxtovw]
minify: 'terser',
terserOptions: {
compress: {
drop_console: true, // 生产环境移除console
drop_debugger: true, // 生产环境移除debugger
},
},
}, },
server: { },
host: '0.0.0.0', assetsInclude: "@dcloudio/uni-ui",
port: 7878, build: {
open: true, minify: "terser",
strictPort: false, // 端口被占用直接退出 terserOptions: {
https: false, // 默认用http方式 compress: {
proxy: { drop_console: true, // 生产环境移除console
'/lowcodeplatform-system': { drop_debugger: true, // 生产环境移除debugger
target: 'http://192.168.1.156', },
// target: 'http://192.168.1.27',
},
'/wms-system': {
target: 'http://192.168.1.156',
// target: 'http://192.168.1.27',
},
},
}, },
},
server: {
host: "0.0.0.0",
port: 7878,
open: true,
strictPort: false, // 端口被占用直接退出
https: false, // 默认用http方式
proxy: {
"/lowcodeplatform-system": {
target: "http://192.168.1.156",
// target: 'http://192.168.1.27',
},
"/wms-system": {
target: "http://192.168.1.156",
// target: 'http://192.168.1.27',
},
},
},
}); });
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论