jevstrudel.git / packages / superdough / vite.config.js
1import { defineConfig } from 'vite';
2import { dependencies } from './package.json';
3import { resolve } from 'path';
4import bundleAudioWorkletPlugin from 'vite-plugin-bundle-audioworklet';
5
6// https://vitejs.dev/config/
7export default defineConfig({
8  plugins: [bundleAudioWorkletPlugin()],
9  build: {
10    lib: {
11      entry: resolve(__dirname, 'index.mjs'),
12      formats: ['es'],
13      fileName: (ext) => ({ es: 'index.mjs', cjs: 'index.cjs' })[ext],
14    },
15    rollupOptions: {
16      external: [...Object.keys(dependencies)],
17    },
18    target: 'esnext',
19  },
20});