forked from razorness/vue-maplibre-gl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
37 lines (35 loc) · 799 Bytes
/
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
// vite.config.js
import { resolve } from 'path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import dts from 'vite-plugin-dts';
export default defineConfig({
plugins: [vue(), dts({ outputDir: 'dist/types' })],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
build: {
lib: {
entry: resolve(__dirname, 'src/entry.ts'),
name: 'VueMaplibreGl',
fileName: (format) => {
let desc = { cjs: 'ssr', es: 'esm', iife: 'min' }[format] || format;
return 'vue-maplibre-gl.' + desc + '.js';
},
formats: ['cjs', 'es', 'iife'],
},
sourcemap: true,
rollupOptions: {
external: ['vue', 'maplibre-gl'],
output: {
exports: 'named',
globals: {
vue: 'Vue',
'maplibre-gl': 'maplibregl',
},
},
},
},
});