forked from Qortal/qortal-ui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
832 B
34 lines
832 B
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) |
|
watcher.on('event', event => { |
|
}) |
|
} |
|
|
|
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
|
|
|