ZAPlayer/vite.lib.simple.config.js
2026-01-30 11:24:39 +08:00

29 lines
659 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'vite'
import { resolve } from 'path'
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/main.js'),
name: 'ZAPlayer',
fileName: (format) => {
if (format === 'es') {
return 'za-player.es.js'
} else if (format === 'umd') {
return 'za-player.min.js'
}
return `za-player.${format}.js`
},
formats: ['es', 'umd']
},
rollupOptions: {
external: [],
output: {
globals: {}
}
},
// 使用esbuild压缩Vite内置无需额外依赖
minify: true,
sourcemap: false
}
})