-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
35 lines (34 loc) · 905 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
import { resolve } from 'path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import pkg from './package.json' assert { type: 'json' };
export default defineConfig({
build: {
target: 'esnext',
minify: 'terser',
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'AccessibleMinimodal',
formats: ['es', 'umd', 'iife', 'cjs'],
fileName: format => `accessible-minimodal.${format}.js`,
},
rollupOptions: {
output: {
banner: `
/*!
* accessible-minimodal v${pkg.version}
* https://github.com/imhvost/accessible-minimodal
*/
`,
footer: `
if (globalThis.AccessibleMinimodal) {
for (const key of Object.keys(globalThis.AccessibleMinimodal)) {
globalThis[key] = globalThis.AccessibleMinimodal[key]
}
}
`,
},
},
},
plugins: [dts()],
});