-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathvite.config.ts
38 lines (38 loc) · 838 Bytes
/
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
/* eslint-disable */
import { defineConfig } from 'vite';
import terser from '@rollup/plugin-terser';
import { getBabelOutputPlugin } from '@rollup/plugin-babel';
import pkg = require('./package.json');
export default defineConfig({
base: './',
resolve: {
alias: {
'@': '/src'
}
},
build: {
lib: {
entry: 'src/index.ts',
name: 'SimPhiVite',
formats: ['es'],
fileName: `script-${pkg.version}`
},
sourcemap: true,
cssTarget: 'chrome61',
rollupOptions: {
external: [/^\/utils\//],
output: {
plugins: [
getBabelOutputPlugin({
plugins: [['@babel/plugin-transform-nullish-coalescing-operator']]
}),
terser({ compress: { passes: 3 } })
]
}
}
},
preview: {
host: true,
port: 4173
}
});