diff options
author | Vendicated <vendicated@riseup.net> | 2022-11-09 19:26:39 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-11-09 19:26:46 +0100 |
commit | 3c8084ec36b82fdf7ea89aaf6558197d9c070ca9 (patch) | |
tree | 35aef25fe43161b00c9b9d47dbc1fda17df4771f /scripts | |
parent | 3b65384b9438f38f612b92ed1276eb6bb0899f50 (diff) | |
download | Vencord-3c8084ec36b82fdf7ea89aaf6558197d9c070ca9.tar.gz Vencord-3c8084ec36b82fdf7ea89aaf6558197d9c070ca9.tar.bz2 Vencord-3c8084ec36b82fdf7ea89aaf6558197d9c070ca9.zip |
Add VSCode debug config
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/build.mjs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/build/build.mjs b/scripts/build/build.mjs index 3d43269..70a05cf 100755 --- a/scripts/build/build.mjs +++ b/scripts/build/build.mjs @@ -44,20 +44,23 @@ const nodeCommonOpts = { define: defines, }; +const sourceMapFooter = s => watch ? "" : `//# sourceMappingURL=vencord://${s}.js.map`; +const sourcemap = watch ? "inline" : "external"; + await Promise.all([ esbuild.build({ ...nodeCommonOpts, entryPoints: ["src/preload.ts"], outfile: "dist/preload.js", - footer: { js: "//# sourceURL=VencordPreload\n//# sourceMappingURL=vencord://preload.js.map" }, - sourcemap: "external", + footer: { js: "//# sourceURL=VencordPreload\n" + sourceMapFooter("preload") }, + sourcemap, }), esbuild.build({ ...nodeCommonOpts, entryPoints: ["src/patcher.ts"], outfile: "dist/patcher.js", - footer: { js: "//# sourceURL=VencordPatcher\n//# sourceMappingURL=vencord://patcher.js.map" }, - sourcemap: "external", + footer: { js: "//# sourceURL=VencordPatcher\n" + sourceMapFooter("patcher") }, + sourcemap, }), esbuild.build({ ...commonOpts, @@ -65,9 +68,9 @@ await Promise.all([ outfile: "dist/renderer.js", format: "iife", target: ["esnext"], - footer: { js: "//# sourceURL=VencordRenderer\n//# sourceMappingURL=vencord://renderer.js.map" }, + footer: { js: "//# sourceURL=VencordRenderer\n" + sourceMapFooter("renderer") }, globalName: "Vencord", - sourcemap: "external", + sourcemap, plugins: [ globPlugins, ...commonOpts.plugins |