mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 19:01:08 +00:00
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
This commit is contained in:
42
js/tsup.config.ts
Normal file
42
js/tsup.config.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
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" };
|
||||
},
|
||||
}),
|
||||
];
|
||||
Reference in New Issue
Block a user