4
1
mirror of https://github.com/Qortal/qortal-ui.git synced 2025-02-12 02:05:51 +00:00

35 lines
832 B
JavaScript
Raw Normal View History

2021-12-25 14:39:47 +01:00
const rollup = require('rollup')
async function watch(options, outputs, outputOptions, inputOptions) {
const watchOptions = {
...inputOptions,
output: outputs.map(option => {
return {
...outputOptions,
...option
}
}),
watch: {
}
}
const watcher = rollup.watch(watchOptions)
2022-02-25 12:21:06 +00:00
watcher.on('event', event => {
2021-12-25 14:39:47 +01:00
})
}
async function writeBundle(bundle, outputOptions) {
await bundle.generate(outputOptions)
await bundle.write(outputOptions)
console.log('WATCH CORE ==> Write Bundle : Done 🎉');
}
async function buildInline(conf) {
const bundle = await rollup.rollup(conf.inputOptions).catch(err => {
throw err
})
await writeBundle(bundle, conf.outputOptions)
}
module.exports = watch