mirror of
https://github.com/tribufu/sdk-js
synced 2025-06-15 10:14:19 +00:00
31 lines
670 B
JavaScript
31 lines
670 B
JavaScript
// Copyright (c) Tribufu. All Rights Reserved.
|
|
|
|
import { build } from "esbuild";
|
|
import { nodeExternalsPlugin } from "esbuild-node-externals";
|
|
|
|
const baseConfig = {
|
|
entryPoints: ["src/index.ts"],
|
|
platform: "neutral",
|
|
target: "node18",
|
|
bundle: true,
|
|
minify: true,
|
|
sourcemap: false,
|
|
legalComments: "linked",
|
|
plugins: [nodeExternalsPlugin()],
|
|
};
|
|
|
|
const moduleConfig = {
|
|
...baseConfig,
|
|
outfile: "build/index.mjs",
|
|
format: "esm",
|
|
};
|
|
|
|
const legacyConfig = {
|
|
...baseConfig,
|
|
outfile: "build/index.cjs",
|
|
format: "cjs",
|
|
};
|
|
|
|
build(moduleConfig).catch(() => process.exit(1));
|
|
build(legacyConfig).catch(() => process.exit(1));
|