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

@@ -12,6 +12,7 @@ async function default_1(name, watchCallback = false) {
let [metaJson, metaString] = (0, readmeta_1.default)(name);
let outPath = (0, paths_1.DistPath)(name);
let error = null;
console.log('build watch?', !watchCallback ? false : 'obj');
try {
await (0, esbuild_1.build)({
entryPoints: [(0, paths_1.ScriptPath)(name).main],
@@ -21,18 +22,20 @@ async function default_1(name, watchCallback = false) {
format: 'esm',
bundle: true,
minify: false,
watch: !watchCallback
? false
: {
onRebuild(err, _result) {
let error = null;
if (err) {
console.error(name, err);
error = err.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}'`,
UserScriptNamespace: `'${metaJson.namespace}'`,