fix: harden worklet caching and build guard
Un-hashed libopenmpt.worklet.js was inheriting the immutable 1-year cache from /assets/, risking stale audio on chiptune3 bumps. Add a dedicated short-cache location for it. Also fail closeBundle loudly if the worklet source vanishes, instead of silently shipping a build with hanging audio.
This commit is contained in:
+5
-1
@@ -30,7 +30,11 @@ function chiptuneWorkletFix(): Plugin {
|
||||
},
|
||||
closeBundle() {
|
||||
const src = resolve('node_modules/chiptune3/libopenmpt.worklet.js')
|
||||
if (!existsSync(src)) return
|
||||
if (!existsSync(src)) {
|
||||
throw new Error(
|
||||
'chiptuneWorkletFix: libopenmpt.worklet.js not found — chiptune3 layout changed?',
|
||||
)
|
||||
}
|
||||
const dest = resolve(outDir, assetsDir, 'libopenmpt.worklet.js')
|
||||
copyFileSync(src, dest)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user