Files
bim_engine/vite.config.ts

44 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-12-03 12:00:46 +08:00
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';
import cssInjectedByJs from 'vite-plugin-css-injected-by-js';
2025-12-16 11:57:44 +08:00
export default defineConfig(() => {
2025-12-03 12:00:46 +08:00
return {
plugins: [
// 移除 Vue 插件
dts({
include: ['src'],
2025-12-04 18:39:07 +08:00
exclude: [
2025-12-16 11:57:44 +08:00
'src/**/*.es.js',
2025-12-04 18:39:07 +08:00
'**/*.es.js'
],
2025-12-04 18:39:07 +08:00
rollupTypes: true,
logLevel: 'warn', // 只显示警告和错误
2025-12-03 12:00:46 +08:00
}),
cssInjectedByJs()
],
2025-12-04 18:39:07 +08:00
// 开发服务器配置
server: {
port: 3000,
open: '/demo/index.html', // 自动打开 demo 页面
},
2025-12-03 12:00:46 +08:00
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'IflowEngine',
fileName: (format) => `iflow-engine.${format}.js`,
2025-12-03 12:00:46 +08:00
},
rollupOptions: {
output: {
globals: {},
// 禁用代码分割,将所有代码打包到一个文件
inlineDynamicImports: true,
2025-12-03 12:00:46 +08:00
},
},
sourcemap: true,
emptyOutDir: true,
},
};
2025-12-16 11:57:44 +08:00
});