Skip to content

Commit 10a07ad

Browse files
committed
Simplify esbuild
1 parent 726600f commit 10a07ad

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Herebyfile.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,12 @@ function createBundler(entrypoint, outfile, taskOptions = {}) {
197197
};
198198

199199
if (taskOptions.usePublicAPI) {
200-
options.external = ["./typescript.js"];
201200
options.plugins = options.plugins || [];
202201
options.plugins.push({
203202
name: "remap-typescript-to-public-api",
204203
setup(build) {
205-
build.onLoad({ filter: /src[\\/]typescript[\\/]typescript\.ts$/ }, () => {
206-
return { contents: `export * from "./typescript.js"` }; // TODO(jakebailey): require(ESM) - this remapping can be fixed up
204+
build.onResolve({ filter: /^(?:\.\.[\\/])*typescript[\\/]typescript\.js$/ }, () => {
205+
return { path: "./typescript.js", external: true };
207206
});
208207
},
209208
});

0 commit comments

Comments
 (0)