@xswap-link/sdk
Version:
JavaScript SDK for XSwap platform
64 lines (62 loc) • 1.42 kB
text/typescript
import { defineConfig } from "tsup";
export default defineConfig(() => {
return [
// Main build configuration
{
entry: ["src/index.ts"],
format: ["cjs", "esm"],
dts: true,
clean: true,
minify: false,
splitting: false,
sourcemap: true,
noExternal: ["ethers"],
outDir: "dist",
esbuildOptions(options) {
options.loader = {
...options.loader,
".ttf": "dataurl",
".eot": "dataurl",
".woff": "dataurl",
".woff2": "dataurl",
};
},
loader: {
".css": "text",
".eot": "file",
".ttf": "file",
".woff": "file",
".woff2": "file",
},
},
// CDN build configuration
{
entry: ["src/index.ts"],
format: ["iife"],
globalName: "XPay",
minify: true,
splitting: false,
sourcemap: false,
target: "chrome110.0",
outDir: "dist",
platform: "browser",
inject: ["./polyfills/buffer.js"],
esbuildOptions(options) {
options.loader = {
...options.loader,
".ttf": "dataurl",
".eot": "dataurl",
".woff": "dataurl",
".woff2": "dataurl",
};
},
loader: {
".css": "text",
".eot": "file",
".ttf": "file",
".woff": "file",
".woff2": "file",
},
},
];
});