-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.component.config.js
37 lines (36 loc) · 984 Bytes
/
vite.component.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
import { defineConfig } from 'vite'
import { viteStaticCopy } from 'vite-plugin-static-copy'
export default defineConfig(({ mode }) => {
let entry = {
'json-resume': './src/index.js',
}
if (mode === 'dsd') {
entry = {
'json-resume-ui': './src/ui.js'
}
}
return {
build: {
copyPublicDir: false,
lib: {
formats: ['es'],
entry
},
rollupOptions: {
external: ['lit', 'lit/directives/choose.js', 'lit/directives/unsafe-html.js', '@lit/task'],
},
target: 'esnext',
},
plugins: [
viteStaticCopy({
targets: [
{ src: './README.md', dest: '.' },
{ src: './custom-elements.json', dest: '.' },
{ src: './src/style.css', dest: '.' },
{ src: './node_modules/jsonresume-theme-microdata/dist/schema.json', dest: '.' },
{ src: './node_modules/jsonresume-theme-microdata/dist/schema.d.ts', dest: '.' },
],
}),
],
}
})