Files
PMTiles/js/tsup.config.ts
Brandon Liu e678dd5326 Pmtiles js v4 (#499)
* pmtiles js v4: remove pmtiles spec v2 compatibility [#287]
* restructure ts files into src
* add tsup for building ESM/CJS and making types work in ESM
* bump fflate dependency
* update CHANGELOG for js 4.0.0
2024-11-26 11:56:41 +08:00

42 lines
777 B
TypeScript

import { defineConfig, type Options } from "tsup";
const baseOptions: Options = {
clean: true,
minify: true,
skipNodeModulesBundle: true,
sourcemap: true,
target: "es6",
tsconfig: "./tsconfig.json",
keepNames: true,
cjsInterop: true,
splitting: true,
};
export default [
defineConfig({
...baseOptions,
entry: ["src/index.ts"],
outDir: "dist/cjs",
format: "cjs",
dts: true,
}),
defineConfig({
...baseOptions,
entry: ["src/index.ts"],
outDir: "dist/esm",
format: "esm",
dts: true,
}),
defineConfig({
...baseOptions,
outDir: "dist",
format: "iife",
globalName: "pmtiles",
entry: {
"pmtiles": "src/index.ts",
},
outExtension: () => {
return { js: ".js" };
},
}),
];