trike-datav/vite.config.js

39 lines
886 B
JavaScript
Raw Permalink Normal View History

2023-11-27 17:18:03 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
2024-01-24 18:53:00 +08:00
server: { // ← ← ← ← ← ←
host: '0.0.0.0' ,// ← 新增内容 ←
port:"8787"
2023-12-02 19:04:16 +08:00
},
2023-11-27 17:18:03 +08:00
optimizeDeps: {
// 开发时 解决这些commonjs包转成esm包
include: [
"@jiaminghi/c-render",
"@jiaminghi/c-render/lib/plugin/util",
"@jiaminghi/charts/lib/util/index",
"@jiaminghi/charts/lib/util",
"@jiaminghi/charts/lib/extend/index",
"@jiaminghi/charts",
"@jiaminghi/color",
],
},
build: {
// 打包时需要另外处理的commonjs规范的包
commonjsOptions: {
include: [
/node_modules/, // 必须包含
],
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
}
})