mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-10 05:08:33 +00:00
30 lines
813 B
JavaScript
30 lines
813 B
JavaScript
import { defineConfig } from 'vite';
|
|
import { dependencies } from './package.json';
|
|
import { resolve } from 'path';
|
|
import replace from '@rollup/plugin-replace';
|
|
import bundleAudioWorkletPlugin from 'vite-plugin-bundle-audioworklet';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
base: './',
|
|
plugins: [bundleAudioWorkletPlugin()],
|
|
build: {
|
|
lib: {
|
|
entry: resolve(__dirname, 'web.mjs'),
|
|
name: 'strudel',
|
|
formats: ['es', 'iife'],
|
|
fileName: (ext) => ({ es: 'index.mjs', iife: 'index.js' })[ext],
|
|
},
|
|
rollupOptions: {
|
|
// external: [...Object.keys(dependencies)],
|
|
plugins: [
|
|
replace({
|
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
preventAssignment: true,
|
|
}),
|
|
],
|
|
},
|
|
target: 'esnext',
|
|
},
|
|
});
|