更新打包配置,完善组件入参模式,新增事件总线
This commit is contained in:
@@ -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;
|
||||
// }
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user