-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
36 lines (35 loc) · 1006 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
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import path from 'path';
import { visualizer } from 'rollup-plugin-visualizer';
import dts from 'vite-plugin-dts';
import replace from '@rollup/plugin-replace';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [preact(), dts()],
build: {
lib: {
// @ts-ignore
entry: path.resolve(__dirname, 'src/main.tsx'),
name: 'simpler-cookie-consent',
fileName: (format) => `simpler-cookie-consent.${format}.js`,
formats: ['es', 'umd'],
},
rollupOptions: {
plugins: [
replace({
'preventAssignment': true,
'process.env.NODE_ENV': JSON.stringify('production'),
}),
visualizer({ filename: './.dev/built-analyzer.html', gzipSize: true, brotliSize: true }),
],
},
},
base: './',
resolve: {
alias: {
'@': path.resolve('', './src'),
},
},
});