-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvite.config.ts
39 lines (37 loc) · 1.13 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
import {vanillaExtractPlugin} from '@vanilla-extract/vite-plugin';
import react from '@vitejs/plugin-react';
import {join} from 'path';
import license from 'rollup-plugin-license';
import {defineConfig} from 'vite';
import {ViteMinifyPlugin} from 'vite-plugin-minify';
export default defineConfig({
optimizeDeps: {exclude: ['tinywidgets'], include: ['tinywidgets > prismjs']},
build: {
outDir: '../docs',
emptyOutDir: true,
rollupOptions: {
input: ['index.html', 'auth.html'],
output: {
manualChunks: (id) =>
id.includes('node_modules/react')
? 'react'
: id.includes('node_modules/tinybase')
? 'tinybase'
: id.includes('node_modules/octokit')
? 'octokit'
: id.includes('node_modules/tinywidgets')
? 'tinywidgets'
: null,
},
},
},
esbuild: {legalComments: 'none'},
plugins: [
react(),
vanillaExtractPlugin(),
license({
thirdParty: {output: join(__dirname, '../docs', 'dependencies.txt')},
}),
ViteMinifyPlugin({minifyJS: {toplevel: true}}),
],
});