-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathvite.config.ts
More file actions
39 lines (36 loc) · 733 Bytes
/
vite.config.ts
File metadata and controls
39 lines (36 loc) · 733 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
38
39
import { defineConfig } from 'vite';
import pkg from './package.json';
const extensions = {
es: 'mjs',
cjs: 'cjs',
umd: 'js',
};
const banner = `/**
* Drag/rotate/resize handler for [leaflet](http://leafletjs.com) vector features.
*
* @author Alexander Milevski <info@w8r.name>
* @license MIT
* @preserve
*/
`;
export default defineConfig({
build: {
lib: {
formats: ['es', 'umd', 'cjs'],
entry: 'src/index.mjs',
name: pkg.name,
fileName: (format) => `index.${extensions[format]}`,
},
rollupOptions: {
external: ['leaflet'],
output: {
banner,
name: 'PathTransform',
globals: { leaflet: 'L' },
},
},
},
server: {
open: true,
},
});