This commit is contained in:
nin0 2025-05-11 09:33:31 -04:00
commit f50d6ae45f
Signed by: nin0
SSH key fingerprint: SHA256:NOoDnFVvZNFvqfXCIhzr6oCTDImZAbTTuyAysZ8Ufk8
9 changed files with 854 additions and 0 deletions

28
build.mjs Normal file
View file

@ -0,0 +1,28 @@
import { build } from "esbuild";
/**
* @type {esbuild.Plugin}
*/
const makeAllPackagesExternalPlugin = {
name: "make-all-packages-external",
setup(build) {
const filter = /^[^./|~]|^\.[^./]|^\.\.[^/]/; // Must not start with "/" or "./" or "../"
build.onResolve({ filter }, (args) => ({
path: args.path,
external: true
}));
}
};
await build({
entryPoints: ["src/index.ts"],
bundle: true,
plugins: [makeAllPackagesExternalPlugin],
platform: "node",
target: "esnext",
sourcemap: "linked",
logLevel: "info",
outfile: "dist/index.js",
minify: true,
treeShaking: true // shake it off shake it offff
});