Skip to content

Commit

Permalink
ci: minify syntax/whitespace
Browse files Browse the repository at this point in the history
also fix output dist
  • Loading branch information
Mara-Li committed May 21, 2024
1 parent 017efd7 commit 9dc44d6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ const exportToVaultFunc = {
return;
}

fs.copyFileSync("./main.js", path.join(folderPlugin, "main.js"));
if (fs.existsSync("./styles.css")) fs.copyFileSync("./styles.css", path.join(folderPlugin, "styles.css"));
fs.copyFileSync(`${outdir}/main.js`, path.join(folderPlugin, "main.js"));
if (fs.existsSync(`${outdir}/styles.css`)) fs.copyFileSync("./styles.css", path.join(folderPlugin, "styles.css"));
fs.copyFileSync("./manifest.json", path.join(folderPlugin, "manifest.json"));
});
}
Expand All @@ -82,12 +82,6 @@ const exportToDist = {
if (!prod) {
return;
}
if (!fs.existsSync(outdir)) {
fs.mkdirSync(outdir);
}
fs.copyFileSync("main.js", path.join(outdir, "main.js"));
if (fs.existsSync("styles.css"))
fs.copyFileSync("styles.css", path.join(outdir, "styles.css"));
fs.copyFileSync("manifest.json", path.join(outdir, "manifest.json"));
});
}
Expand Down Expand Up @@ -115,11 +109,12 @@ const context = await esbuild.context({
"@lezer/lr",
...builtins],
format: "cjs",
target: "es2018",
target: "esnext",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
minify: prod ? true : false,
minifySyntax: prod,
minifyWhitespace: prod,
outdir,
plugins: [moveStyles, exportToDist, exportToVaultFunc],
});
Expand Down

0 comments on commit 9dc44d6

Please sign in to comment.