mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
46 lines
861 B
TypeScript
46 lines
861 B
TypeScript
import { defineConfig, type Options } from "tsup";
|
|
|
|
const baseOptions: Options = {
|
|
clean: true,
|
|
minify: false,
|
|
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,
|
|
esbuildOptions: (options) => {
|
|
options.platform = "browser";
|
|
},
|
|
outDir: "dist",
|
|
format: "iife",
|
|
globalName: "olpmtiles",
|
|
entry: {
|
|
"olpmtiles": "src/index.ts",
|
|
},
|
|
outExtension: () => {
|
|
return { js: ".js" };
|
|
},
|
|
}),
|
|
];
|