更新打包配置,完善组件入参模式,新增事件总线

This commit is contained in:
2025-05-08 11:34:35 +08:00
parent cfbfda520d
commit 4a648c2f97
14 changed files with 1091 additions and 26609 deletions

View File

@@ -1,5 +1,6 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import dts from 'vite-plugin-dts';
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
@@ -7,20 +8,29 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [vue(), dts({rollupTypes: true, tsconfigPath: './tsconfig.app.json',insertTypesEntry: true})],
build: {
lib: {
entry: resolve(__dirname, 'src/lib/index.ts'),
name: 'MaterialEditor',
fileName: (format) => `material-editor.${format}.js`
fileName: (format) => `material-editor.${format}.js`,
formats: ['es']
},
rollupOptions: {
external: ['vue'],
// external: ['vue'],
output: {
globals: {
vue: 'Vue'
}
}
},
// manualChunks: (id) => {
// if (id.includes('node_modules'))
// {
// if(/three/.test(id))
// return 'three';
// }
// return null;
// }
},
}
}
})