-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.ts
66 lines (60 loc) · 1.79 KB
/
vite.config.ts
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { defineConfig } from 'vite'
import path from 'path'
import { viteStaticCopy } from 'vite-plugin-static-copy'
import litCss from 'vite-plugin-lit-css'
import dts from 'vite-plugin-dts'
export default defineConfig({
build: {
sourcemap: true,
lib: {
entry: [
path.resolve(__dirname, './src/alert/alert.ts'),
path.resolve(__dirname, './src/avatar/avatar.ts'),
path.resolve(__dirname, './src/button/button.ts'),
path.resolve(__dirname, './src/card/card.ts'),
path.resolve(__dirname, './src/checkbox/checkbox.ts'),
path.resolve(__dirname, './src/chip/chip.ts'),
path.resolve(__dirname, './src/dialog/dialog.ts'),
path.resolve(__dirname, './src/radio/radio.ts'),
path.resolve(__dirname, './src/ripple/ripple.ts'),
path.resolve(__dirname, './src/select/select-option.ts'),
path.resolve(__dirname, './src/select/select.ts'),
path.resolve(__dirname, './src/text-field/text-field.ts'),
path.resolve(__dirname, './src/index.ts')
],
formats: ['es']
},
rollupOptions: {
external: /^lit/,
output: {
globals: {
lit: 'lit',
'lit/decorators.js': 'lit/decorators',
'lit/directives/style-map.js': 'lit/directives/style-map',
'lit/directives/class-map.js': 'lit/directives/class-map',
'lit/directives/when.js': 'lit/directives/when'
}
}
}
},
plugins: [
// transform styles
litCss({
exclude: [/assets\/.*/]
}),
// Generate d.ts.
dts({
outDir: './dist/types',
exclude: 'src/**/*.stories.ts'
}),
// Generate static files.
viteStaticCopy({
targets: [
{
src: './src/assets/**/*.css',
dest: './assets'
}
]
})
]
})