diff --git a/package-lock.json b/package-lock.json index 55ff34f..61b9792 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@maptiler/elevation-profile-control", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@maptiler/elevation-profile-control", - "version": "3.0.0", + "version": "3.0.1", "dependencies": { "@maptiler/sdk": "^3.0.0", "@types/events": "^3.0.0", diff --git a/package.json b/package.json index 7fc5e68..1105689 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@maptiler/elevation-profile-control", - "version": "3.0.0", + "version": "3.0.1", "description": "Elevation profile control for MapTiler SDK", "module": "dist/maptiler-elevation-profile-control.js", "types": "dist/maptiler-elevation-profile-control.d.ts", diff --git a/src/elevationprofilecontrol.ts b/src/elevationprofilecontrol.ts index 50d8a35..cef1f5d 100644 --- a/src/elevationprofilecontrol.ts +++ b/src/elevationprofilecontrol.ts @@ -10,7 +10,7 @@ import elevationIcon from "./images/elevation-icon.svg"; import elevationFillIcon from "./images/elevation_fill-icon.svg"; import type { GeoJsonObject } from "geojson"; -import packagejson from "../package.json"; +import { name, version } from "../package.json"; /** * Elevation profile control options @@ -84,7 +84,7 @@ export class ElevationProfileControl implements IControl { } onAdd(map: MapSDK): HTMLElement { - map.telemetry.registerModule(packagejson.name, packagejson.version); + map.telemetry.registerModule(name, version); this.map = map; diff --git a/vite.config-es.ts b/vite.config-es.ts index 47ba412..7839a06 100644 --- a/vite.config-es.ts +++ b/vite.config-es.ts @@ -4,10 +4,6 @@ import dts from 'vite-plugin-dts'; const isProduction = process.env.NODE_ENV === "production"; -const plugins = [ - dts({insertTypesEntry: true}), -]; - export default defineConfig({ mode: isProduction ? "production" : "development", build: { @@ -41,5 +37,10 @@ export default defineConfig({ }, }, }, - plugins, -}) \ No newline at end of file + plugins: [ + dts({ + insertTypesEntry: true, + entryRoot: "src", + }), + ], +}); diff --git a/vite.config-umd.ts b/vite.config-umd.ts index 42d57d6..b744a19 100644 --- a/vite.config-umd.ts +++ b/vite.config-umd.ts @@ -3,38 +3,31 @@ import { defineConfig } from 'vite'; const isProduction = process.env.NODE_ENV === "production"; -const plugins = []; - - export default defineConfig({ mode: isProduction ? "production" : "development", build: { outDir: "build", minify: isProduction, - sourcemap: !isProduction, + sourcemap: true, lib: { - // Could also be a dictionary or array of multiple entry points entry: resolve(__dirname, 'src/maptiler-elevation-profile-control.ts'), name: 'maptilerelevationprofilecontrol', - // the proper extensions will be added - fileName: (format, entryName) => `${entryName}.${format}.js`, + fileName: (format, entryName) => `${entryName}.${format}.min.js`, formats: ['umd'], }, rollupOptions: { - // make sure to externalize deps that shouldn't be bundled - // into your library + // make sure to externalize deps that shouldn't be bundled into your library external: [ "@maptiler/sdk" ], output: { - // Provide global variables to use in the UMD build - // for externalized deps + // Provide global variables to use in the UMD build for externalized deps globals: { "@maptiler/sdk": "maptilersdk", }, }, }, }, - plugins, -}) \ No newline at end of file + plugins: [], +});