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
This commit is contained in:
Brandon Liu
2024-09-11 16:36:48 +08:00
committed by GitHub
parent 089d13d637
commit ab5534df7e
11 changed files with 2429 additions and 580 deletions

42
openlayers/tsup.config.ts Normal file
View File

@@ -0,0 +1,42 @@
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" };
},
}),
];