switch to esbuild 0.17
This commit is contained in:
parent
5d69caa27e
commit
aa0a821eaf
|
@ -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');
|
const prod = (process.argv[2] === 'production');
|
||||||
|
|
||||||
esbuild.build({
|
const context = await esbuild.context({
|
||||||
banner: {
|
banner: {
|
||||||
js: banner,
|
js: banner,
|
||||||
},
|
},
|
||||||
|
@ -33,10 +33,16 @@ esbuild.build({
|
||||||
'@lezer/lr',
|
'@lezer/lr',
|
||||||
...builtins],
|
...builtins],
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
watch: !prod,
|
|
||||||
target: 'es2018',
|
target: 'es2018',
|
||||||
logLevel: "info",
|
logLevel: "info",
|
||||||
sourcemap: prod ? false : 'inline',
|
sourcemap: prod ? false : 'inline',
|
||||||
treeShaking: true,
|
treeShaking: true,
|
||||||
outfile: 'main.js',
|
outfile: 'main.js',
|
||||||
}).catch(() => process.exit(1));
|
})
|
||||||
|
|
||||||
|
if (prod) {
|
||||||
|
await context.rebuild()
|
||||||
|
context.dispose()
|
||||||
|
} else {
|
||||||
|
await context.watch()
|
||||||
|
}
|
Loading…
Reference in New Issue