-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
52 lines (51 loc) · 1.22 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
44
45
46
47
48
49
50
51
52
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
export default defineConfig({
base: '/retsgeografi/', // Relative base path
build: {
lib: {
entry: 'main.js',
name: 'MapViewerPlugin',
fileName: (format) => `map-viewer-plugin.${format}.js`,
},
rollupOptions: {
external: ['ol, lit'], // Only keep 'ol' external
output: {
globals: {
ol: 'ol',
lit: 'lit',
},
},
input: 'index.html', // Include index.html
},
outDir: 'dist', // Output directory
sourcemap: true,
},
optimizeDeps: {
include: ['lit'],
},
plugins: [
viteStaticCopy({
targets: [
{
src: 'public/examples', // Copy the src/examples folder
dest: '', // Place in the root of /dist
},
{
src: 'node_modules/@dataforsyningen', // Copy everything from the package
dest: '', // Place in /dist/designsystem
},
{
src: 'node_modules/@nieuwlandgeo', // Copy everything from the package}
dest: '',
}
],
}),
],
assetsInclude: ['**/*.svg'],
server: {
open: true,
port: 5000,
cors: true,
},
});