-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathvite.config.leaflet.ts
More file actions
37 lines (35 loc) · 698 Bytes
/
vite.config.leaflet.ts
File metadata and controls
37 lines (35 loc) · 698 Bytes
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
import { defineConfig } from 'vite';
import { resolve } from 'path';
import pkg from './package.json';
const banner = `\
/**
* ${pkg.name} v${pkg.version}
* ${pkg.description}
*
* @author ${pkg.author}
* @license ${pkg.license}
* @preserve
*/
`;
export default defineConfig({
build: {
emptyOutDir: false,
lib: {
entry: resolve(__dirname, 'src/leaflet.ts'),
name: 'greinerHormann',
formats: ['es', 'umd'],
fileName: (format) => {
if (format === 'es') {
return 'leaflet.js';
}
return `leaflet.${format}.js`;
},
},
sourcemap: true,
rollupOptions: {
output: {
banner,
},
},
},
});