Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
GordonSmith committed Aug 18, 2024
1 parent a6b84a2 commit 7adfa77
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function main(entryPoint, platform, format, plugins = []) {
external: ["vscode", "fs", "path", "os"],
// mainFields: platform === "node" ? ["main", "module"] : undefined, // https://github.com/microsoft/node-jsonc-parser/issues/57
logLevel: production ? "silent" : "info",
write: !plugins.some(p => p.name === "replace-after-transform"),
// write: !plugins.some(p => p.name === "replace-after-transform"),
plugins: [
...plugins,
esbuildProblemMatcherPlugin,
Expand Down Expand Up @@ -56,10 +56,9 @@ function replaceAfterTransform() {
return {
name: "replace-after-transform",
setup(build) {
build.initialOptions.write = false;
build.onEnd((result) => {
console.log("replace-after-transform");
result?.outputFiles?.forEach(file => {
console.log(file.path);
if (file.path.endsWith(".js")) {
const contents = file.text.replace(/"use strict";/g, "");
if (contents.indexOf("use strict") >= 0) {
Expand Down

0 comments on commit 7adfa77

Please sign in to comment.