add custom watchbuild script to work around rollup
parent
9df8feffda
commit
237f7ee1fc
@ -0,0 +1,27 @@
|
||||
//stupid hack to
|
||||
// - reload our config on every build
|
||||
// - make the jscc plugin work properly
|
||||
//why doesn't rollup watch do either of these things? no idea!
|
||||
|
||||
const loadConfigFile = require('rollup/loadConfigFile');
|
||||
const path = require('path');
|
||||
const rollup = require('rollup');
|
||||
const chokidar = require('chokidar')
|
||||
const process = require('child_process')
|
||||
|
||||
let ready = false
|
||||
|
||||
const watch = chokidar.watch(["./src", "./options.toml", "./rollup.config.js"], {
|
||||
persistent: true
|
||||
})
|
||||
|
||||
watch.on("all", async (eve, path) => {
|
||||
if (ready) {
|
||||
process.execSync("pnpm run build")
|
||||
}
|
||||
})
|
||||
|
||||
watch.on("ready", () => {
|
||||
console.log(`Watching files...`)
|
||||
ready = true
|
||||
})
|
Loading…
Reference in new issue