37 lines
965 B
JavaScript
37 lines
965 B
JavaScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue2';
|
|
import * as path from 'path';
|
|
import libCss from 'vite-plugin-libcss';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [vue(), libCss()],
|
|
server: {
|
|
port: 5172,
|
|
proxy: {
|
|
'/park': 'http://ltggtczygl.com/wechat/wechat/',
|
|
},
|
|
},
|
|
build: {
|
|
cssCodeSplit: true,
|
|
lib: {
|
|
// Could also be a dictionary or array of multiple entry points
|
|
entry: path.resolve(__dirname, 'src/lib/main.js'),
|
|
name: 'bimland',
|
|
// the proper extensions will be added
|
|
fileName: 'bimland',
|
|
},
|
|
rollupOptions: {
|
|
// 确保外部化处理那些你不想打包进库的依赖
|
|
external: ['vue', 'element-ui'],
|
|
output: {
|
|
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
|
globals: {
|
|
vue: 'Vue',
|
|
'element-ui': 'element-ui',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|