disabled watch for now

This commit is contained in:
2022-06-08 17:22:36 -05:00
parent 78e9531e83
commit 5c29ba1ef2
7 changed files with 38 additions and 28 deletions

View File

@@ -16,6 +16,8 @@ export default async function (
let error: string | null = null
console.log('build watch?', !watchCallback ? false : 'obj')
try {
await build({
entryPoints: [ScriptPath(name).main],
@@ -28,18 +30,21 @@ export default async function (
bundle: true,
minify: false,
watch: !watchCallback
? false
: {
onRebuild(err, _result) {
let error = null
if (err) {
console.error(name, err)
error = (err as BuildFailure).message
}
watchCallback(metaJson, error)
},
},
// write: false, //TODO this will cause result.outputFiles to have the file contents so i can write the file instead
// watch: !watchCallback
// ? false
// : {
// onRebuild(err, _result) {
// console.log('onrebuild')
// let error = null
// if (err) {
// console.error(name, err)
// error = (err as BuildFailure).message
// }
// watchCallback(metaJson, error)
// },
// },
define: {
UserScriptName: `'${metaJson.name}'`,

View File

@@ -47,6 +47,7 @@ readdirSync(DistBase).forEach(file => unlinkSync(`${DistBase}/${file}`))
meta: UserScriptMetaFull,
error: string | null
) {
console.log('watch callback')
scriptMeta[id] = { meta, error }
doErrorFile(path.error, DistPath(name), error)