Skip to content

Commit 622f1f2

Browse files
authored
Fix declarations files generation (#17)
1 parent 1e7d4ea commit 622f1f2

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@maptiler/3d",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Add 3D things to your map, plugin for MapTiler SDK",
55
"module": "dist/maptiler-3d.js",
66
"types": "dist/maptiler-3d.d.ts",

src/Layer3D.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
getVersion,
88
} from "@maptiler/sdk";
99

10-
import packagejson from "../package.json";
10+
import { name, version } from "../package.json";
1111

1212
import {
1313
Camera,
@@ -270,7 +270,7 @@ export class Layer3D implements CustomLayerInterface {
270270
* Automatically called when the layer is added. (should not be called manually)
271271
*/
272272
onAdd?(map: MapSDK, gl: WebGL2RenderingContext): void {
273-
map.telemetry.registerModule(packagejson.name, packagejson.version);
273+
map.telemetry.registerModule(name, version);
274274

275275
this.map = map;
276276

vite.config-es.ts

+9-13
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,34 @@ import dts from 'vite-plugin-dts';
44

55
const isProduction = process.env.NODE_ENV === "production";
66

7-
const plugins = [
8-
dts({insertTypesEntry: true}),
9-
];
10-
117
export default defineConfig({
128
mode: isProduction ? "production" : "development",
139
build: {
1410
minify: isProduction,
1511
sourcemap: true,
1612
lib: {
17-
// Could also be a dictionary or array of multiple entry points
1813
entry: resolve(__dirname, 'src/maptiler-3d.ts'),
1914
name: 'maptiler3d',
20-
// the proper extensions will be added
2115
fileName: (format, entryName) => `${entryName}.js`,
2216
formats: ['es'],
2317
},
24-
2518
rollupOptions: {
26-
// make sure to externalize deps that shouldn't be bundled
27-
// into your library
19+
// make sure to externalize deps that shouldn't be bundled into your library
2820
external: [
2921
"three",
3022
"LRUCache",
3123
"@maptiler/sdk",
3224
],
3325
output: {
34-
// Provide global variables to use in the UMD build
35-
// for externalized deps
26+
// Provide global variables to use in the UMD build for externalized deps
3627
globals: {},
3728
},
3829
},
3930
},
40-
plugins,
41-
})
31+
plugins:[
32+
dts({
33+
insertTypesEntry: true,
34+
entryRoot: "src",
35+
}),
36+
],
37+
});

0 commit comments

Comments
 (0)