-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
41 lines (39 loc) · 1021 Bytes
/
vite.config.ts
File metadata and controls
41 lines (39 loc) · 1021 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
40
41
import { defineConfig } from 'vite'
import { readFileSync } from 'fs'
import replace from '@rollup/plugin-replace'
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'))
export default defineConfig({
server: {
open: '/demo/',
port: 8000
},
resolve: {
alias: {
tslib: 'tslib/tslib.es6.js'
},
conditions: ['browser']
},
define: {
'process.env.NODE_ENV': JSON.stringify('production')
},
plugins: [
replace({
versionplaceholder: pkg.version,
preventAssignment: true
})
],
build: {
lib: {
entry: 'src/widget-switch.ts',
formats: ['es'],
fileName: 'widget-switch'
},
sourcemap: true,
rollupOptions: {
external: [/^lit/, /^@lit/, /^@material\/web/],
output: {
banner: '/* @license Copyright (c) 2025 IronFlock GmbH. All rights reserved.*/'
}
}
}
})