修复材质导出问题,添加库打包模式

This commit is contained in:
2025-04-15 09:35:54 +08:00
parent 0929d5b80c
commit cfbfda520d
11 changed files with 26706 additions and 116 deletions

View File

@@ -1,7 +1,26 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
build: {
lib: {
entry: resolve(__dirname, 'src/lib/index.ts'),
name: 'MaterialEditor',
fileName: (format) => `material-editor.${format}.js`
},
rollupOptions: {
external: ['vue'],
output: {
globals: {
vue: 'Vue'
}
}
}
}
})