From aa0a821eafa775eb59caba5b8d8a9d71eb4d3ca2 Mon Sep 17 00:00:00 2001 From: Inhji Date: Wed, 9 Aug 2023 19:41:56 +0200 Subject: [PATCH] switch to esbuild 0.17 --- esbuild.config.mjs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/esbuild.config.mjs b/esbuild.config.mjs index 4d9a0f3..92846f1 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -11,7 +11,7 @@ if you want to view the source, please visit the github repository of this plugi const prod = (process.argv[2] === 'production'); -esbuild.build({ +const context = await esbuild.context({ banner: { js: banner, }, @@ -33,10 +33,16 @@ esbuild.build({ '@lezer/lr', ...builtins], format: 'cjs', - watch: !prod, target: 'es2018', logLevel: "info", sourcemap: prod ? false : 'inline', treeShaking: true, outfile: 'main.js', -}).catch(() => process.exit(1)); +}) + +if (prod) { + await context.rebuild() + context.dispose() +} else { + await context.watch() +} \ No newline at end of file