init
This commit is contained in:
commit
f50d6ae45f
9 changed files with 854 additions and 0 deletions
28
build.mjs
Normal file
28
build.mjs
Normal 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
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue