Skip to content

Commit

Permalink
fix: local esm resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Carniato committed Dec 13, 2021
1 parent 2249c80 commit 4743449
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,21 @@ import { build, BuildOptions } from "esbuild";
build({
...opts,
format: "esm",
bundle: true,
splitting: true,
outExtension: { ".js": ".mjs" },
plugins: [
{
name: "make-all-packages-external",
setup(build) {
const filter = /^[^./]|^\.[^./]|^\.\.[^/]/; // Must not start with "/" or "./" or "../"
build.onResolve({ filter }, (args) => ({
path: args.path,
external: true,
}));
},
},
],
}),
]);
})().catch((err) => {
Expand Down

0 comments on commit 4743449

Please sign in to comment.