-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
52 lines (50 loc) · 1.34 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
import pkg from './package.json'
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import { resolve } from 'path';
import banner from 'vite-plugin-banner'
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'Spring',
formats: ['es', 'cjs', 'umd'],
fileName: (format) => {
switch (format) {
case 'es':
return 'index.mjs';
case 'cjs':
return 'index.cjs';
case 'umd':
return 'index.umd.js';
default:
return 'index.js';
}
},
},
sourcemap: true,
// Optimize output
minify: 'terser',
terserOptions: {
compress: {
passes: 2,
},
},
},
plugins: [
dts({
insertTypesEntry: true,
}),
banner(
`/*!
* Rk4thSpring - ${pkg.version}
* Copyright (c) ${new Date().getFullYear()}. Khaled Sameer<[email protected]>
*
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://github.com/KhaledSMQ/Rk4thSpring for details.
*/
/* eslint-disable */
`,
),
],
});