mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-08-01 14:41:24 +00:00
Initial commit
This commit is contained in:
43
qortal-ui-core/tooling/watch.js
Normal file
43
qortal-ui-core/tooling/watch.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const rollup = require('rollup')
|
||||
|
||||
async function watch(options, outputs, outputOptions, inputOptions) {
|
||||
|
||||
const watchOptions = {
|
||||
...inputOptions,
|
||||
output: outputs.map(option => {
|
||||
return {
|
||||
...outputOptions,
|
||||
...option
|
||||
}
|
||||
}),
|
||||
watch: {
|
||||
// chokidar,
|
||||
// clearScreen,
|
||||
// exclude,
|
||||
// include
|
||||
}
|
||||
}
|
||||
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
|
Reference in New Issue
Block a user