Files
simapi-vue/vite.core.config.ts
T

23 lines
635 B
TypeScript
Raw Normal View History

2026-04-08 01:07:10 +08:00
import { defineConfig } from 'vite'
2026-04-08 01:45:53 +08:00
export default defineConfig({
2026-04-08 01:07:10 +08:00
build: {
outDir: 'dist',
emptyOutDir: true,
lib: {
entry: 'src/simapi.core.ts',
name: 'SimApiCore',
formats: ['es', 'cjs'],
fileName: (format) => `index.${format === 'es' ? 'mjs' : 'cjs'}`
},
rollupOptions: {
// 不再需要 external,使用原生 fetch
}
2026-04-08 01:51:14 +08:00
},
define: {
// SimApiVersion 由构建注入,AppVersion 留给调用方 APP 注入
// 使用方式: npm run build -- --SimApiVersion=1.0.0
'SimApiVersion': JSON.stringify(process.env.npm_config_SimApiVersion || '0.0.0-develop'),
2026-04-08 01:07:10 +08:00
}
2026-04-08 01:45:53 +08:00
})