31 lines
819 B
TypeScript
31 lines
819 B
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { defineConfig } from 'vite'
|
|
|
|
const peerDependencies = ['vue', 'd3', 'ant-design-vue', 'vue3-colorpicker']
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
emptyOutDir: true,
|
|
lib: {
|
|
entry: fileURLToPath(new URL('./src/index.ts', import.meta.url)),
|
|
name: 'WaveformAnalysis',
|
|
formats: ['es', 'cjs'],
|
|
fileName: (format) => (format === 'es' ? 'index.js' : 'index.cjs'),
|
|
cssFileName: 'style',
|
|
},
|
|
rolldownOptions: {
|
|
external: (id) =>
|
|
peerDependencies.some((dependency) => id === dependency || id.startsWith(`${dependency}/`)),
|
|
},
|
|
},
|
|
})
|