Files
PMTiles/openlayers/tsup.config.ts
Brandon Liu ab5534df7e change ol-pmtiles to TypeScript [#312] (#444)
* change ol-pmtiles to TypeScript [#444]

* olpmtiles: 1.0.0
* accept either a string or pmtiles.Source for the url option
* package.json works for ESM/CJS/IIFE [#312, #443]
* replace npm install with npm ci on github actions
2024-09-11 16:36:48 +08:00

43 lines
783 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,
outDir: "dist",
format: "iife",
globalName: "olpmtiles",
entry: {
"olpmtiles": "src/index.ts",
},
outExtension: () => {
return { js: ".js" };
},
}),
];