add vite-plugin-bundle-audioworklet and use it both from website and superdough

This commit is contained in:
Felix Roos 2025-05-01 23:26:04 +02:00
parent 7bec92ca99
commit fdbbcd2dd2
No known key found for this signature in database
7 changed files with 44 additions and 8 deletions

View file

@ -32,7 +32,8 @@
},
"homepage": "https://github.com/tidalcycles/strudel#readme",
"devDependencies": {
"vite": "^6.0.11"
"vite": "^6.0.11",
"vite-plugin-bundle-audioworklet": "workspace:*"
},
"dependencies": {
"nanostores": "^0.11.3"

View file

@ -1,7 +1,7 @@
import { defineConfig } from 'vite';
import { dependencies } from './package.json';
import { resolve } from 'path';
import { bundleAudioWorkletPlugin } from './vite-plugin-bundle-audioworklet';
import bundleAudioWorkletPlugin from 'vite-plugin-bundle-audioworklet';
// https://vitejs.dev/config/
export default defineConfig({

View file

@ -0,0 +1,19 @@
{
"name": "vite-plugin-bundle-audioworklet",
"main": "./vite-plugin-bundle-audioworklet.js",
"version": "0.1.0",
"description": "",
"keywords": [
"tidalcycles",
"strudel",
"pattern",
"livecoding",
"algorave"
],
"author": "Felix Roos <flix91@gmail.com>",
"license": "AGPL-3.0-or-later",
"type": "module",
"devDependencies": {
"vite": "^6.0.11"
}
}

View file

@ -2,12 +2,12 @@ import { createLogger, build } from 'vite';
const end = '?audioworklet';
export function bundleAudioWorkletPlugin() /* : PluginOption */ {
function bundleAudioWorkletPlugin() /* : PluginOption */ {
let viteConfig /* : UserConfig */;
return {
name: 'vite-plugin-bundle-audioworklet',
apply: 'build',
/* apply: 'build', */
enforce: 'post',
config(config) {
@ -44,3 +44,5 @@ export function bundleAudioWorkletPlugin() /* : PluginOption */ {
},
};
}
export default bundleAudioWorkletPlugin;