From 027c669ad7dd7fc4eebf8493489619cbabb8b9c8 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Tue, 3 Jan 2023 22:17:44 +0100 Subject: [PATCH] make prebake relative to BASE_URL --- website/src/repl/prebake.mjs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/website/src/repl/prebake.mjs b/website/src/repl/prebake.mjs index bdd7f8d3..27bf521c 100644 --- a/website/src/repl/prebake.mjs +++ b/website/src/repl/prebake.mjs @@ -1,17 +1,18 @@ import { Pattern, toMidi, valueToMidi } from '@strudel.cycles/core'; import { samples } from '@strudel.cycles/webaudio'; -export async function prebake({ baseDir = '' } = {}) { +export async function prebake() { + const { BASE_URL = '/' } = import.meta.env; // https://archive.org/details/SalamanderGrandPianoV3 // License: CC-by http://creativecommons.org/licenses/by/3.0/ Author: Alexander Holm return await Promise.all([ - samples('/piano.json', `${baseDir}/piano/`), + samples(`${BASE_URL}piano.json`, `${BASE_URL}piano/`), // https://github.com/sgossner/VCSL/ // https://api.github.com/repositories/126427031/contents/ // LICENSE: CC0 general-purpose - samples('/vcsl.json', 'github:sgossner/VCSL/master/'), - samples('/tidal-drum-machines.json', 'github:ritchse/tidal-drum-machines/main/machines/'), - samples('/EmuSP12.json', `${baseDir}/EmuSP12/`), + samples(`${BASE_URL}vcsl.json`, 'github:sgossner/VCSL/master/'), + samples(`${BASE_URL}tidal-drum-machines.json`, 'github:ritchse/tidal-drum-machines/main/machines/'), + samples(`${BASE_URL}EmuSP12.json`, `${BASE_URL}EmuSP12/`), // samples('github:tidalcycles/Dirt-Samples/master'), ]); }