Skip to content

Commit

Permalink
Fix declarations files generation
Browse files Browse the repository at this point in the history
  • Loading branch information
sebstryczek committed Jan 7, 2025
1 parent 0d333ff commit 00867a8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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/",
Expand Down
4 changes: 2 additions & 2 deletions src/MaptilerARControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
22 changes: 9 additions & 13 deletions vite.config-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
})
plugins: [
dts({
insertTypesEntry: true,
entryRoot: "src",
}),
],
});

0 comments on commit 00867a8

Please sign in to comment.