From 00867a8f0b123da0eaabdb3e6deb1c60a818ed73 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 7 Jan 2025 16:49:05 +0100 Subject: [PATCH] Fix declarations files generation --- package-lock.json | 4 ++-- package.json | 2 +- src/MaptilerARControl.ts | 4 ++-- vite.config-es.ts | 22 +++++++++------------- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index bcf01d1..580f220 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@maptiler/ar-control", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@maptiler/ar-control", - "version": "3.0.0", + "version": "3.0.1", "license": "See LICENSE.md", "dependencies": { "@capacitor-community/file-opener": "^1.0.5", diff --git a/package.json b/package.json index 44a976e..b78976b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@maptiler/ar-control", - "version": "3.0.0", + "version": "3.0.1", "description": "AR Control for MapTiler SDK", "type": "module", "homepage": "https://docs.maptiler.com/sdk-js/modules/ar/", diff --git a/src/MaptilerARControl.ts b/src/MaptilerARControl.ts index 603bc87..4ec8736 100644 --- a/src/MaptilerARControl.ts +++ b/src/MaptilerARControl.ts @@ -21,7 +21,7 @@ import { USDZExporter } from "three/examples/jsm/exporters/USDZExporter.js"; import { addWatermarkToContext, blobToBase64 } from "./tools"; -import packagejson from "../package.json"; +import { name, version } from "../package.json"; type CameraSettings = { center: LngLat; @@ -377,7 +377,7 @@ export class MaptilerARControl extends EventEmitter implements IControl { } onAdd(map: MapSDK): HTMLElement { - map.telemetry.registerModule(packagejson.name, packagejson.version); + map.telemetry.registerModule(name, version); this.setMap(map); diff --git a/vite.config-es.ts b/vite.config-es.ts index d8b2d82..7589615 100644 --- a/vite.config-es.ts +++ b/vite.config-es.ts @@ -4,27 +4,19 @@ 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: { minify: isProduction, sourcemap: !isProduction, lib: { - // Could also be a dictionary or array of multiple entry points entry: resolve(__dirname, 'src/maptiler-ar-control.ts'), name: 'maptilerarcontrol', - // the proper extensions will be added fileName: (format, entryName) => `${entryName}.js`, formats: ['es'], }, - 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: [ "three", "events", @@ -35,11 +27,15 @@ export default defineConfig({ "@capacitor/core", ], 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: {}, }, }, }, - plugins, -}) \ No newline at end of file + plugins: [ + dts({ + insertTypesEntry: true, + entryRoot: "src", + }), + ], +});