aieditor/vite.config.ts

30 lines
796 B
TypeScript
Raw Normal View History

2023-11-12 12:18:57 +08:00
import {defineConfig} from 'vite'
import {resolve} from 'path';
import dts from 'vite-plugin-dts'
2023-11-12 14:09:46 +08:00
2023-11-12 12:18:57 +08:00
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, './src/index.ts'),
name: 'aieditor',
2023-11-12 14:09:46 +08:00
// fileName: (format) => `index.${format}.js`,
2023-11-12 12:18:57 +08:00
fileName: `index`,
2023-11-12 14:09:46 +08:00
formats: ['es', 'cjs']
2023-11-12 12:18:57 +08:00
},
rollupOptions: {
// 排除不相关的依赖
2023-11-12 14:09:46 +08:00
// external: [],
2023-11-12 12:18:57 +08:00
// output: {
// // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
// globals: {
// react: 'React',
// },
// },
},
// outDir: 'dist',
2023-11-12 14:09:46 +08:00
2023-11-12 12:18:57 +08:00
},
plugins: [dts({rollupTypes: true})],
})