forked from SINTEF-9012/PruneCluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
43 lines (42 loc) · 1.27 KB
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import {defineConfig} from 'vite';
import {resolve} from 'path';
import {terser} from 'rollup-plugin-terser';
import dts from 'vite-plugin-dts';
export default defineConfig({
plugins: [
dts({
insertTypesEntry: true,
outputDir: 'dist',
staticImport: true,
})
],
build: {
rollupOptions: {
plugins: [
terser({
format: {
comments: false,
},
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['performance.mark', 'performance.measure'],
}
})
],
external: ['leaflet'], // Exclude Leaflet from the bundle
output: {
globals: {
leaflet: 'L', // Refer to Leaflet as the global `L`
},
},
},
lib: {
entry: resolve(__dirname, 'src/index.ts'), // Adjust to your entry file
name: 'LeafletClustering',
fileName: 'index',
formats: ['umd', 'iife', 'es'], // UMD and IIFE formats for the browser
},
target: 'modules'
},
});