-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
75 lines (74 loc) · 1.64 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { defineConfig } from 'vite';
import legacy from '@vitejs/plugin-legacy';
import solidPlugin from 'vite-plugin-solid';
import pages from 'vite-plugin-pages-solid';
import solidSvg from 'vite-plugin-solid-svg';
import WindiCSS from 'vite-plugin-windicss';
import tsconfigPaths from 'vite-tsconfig-paths';
import { minifyHtml } from 'vite-plugin-html';
//import sri from 'rollup-plugin-sri';
export default defineConfig({
plugins: [
tsconfigPaths(),
solidPlugin(),
solidSvg({ defaultExport: 'component' }),
WindiCSS(),
pages({
pagesDir: 'src/routes',
//extensions: ['.jsx', '.tsx'],
importMode: 'async',
syncIndex: false,
}),
// https://vitejs.dev/plugins/#vitejs-plugin-legacy
legacy(),
minifyHtml({
collapseWhitespace: true,
decodeEntities: true,
minifyCSS: true,
minifyJS: true,
processConditionalComments: true,
removeAttributeQuotes: false,
removeComments: true,
removeEmptyAttributes: true,
useShortDoctype: false,
}),
/*{
enforce: 'post',
...sri({
publicPath: '/',
algorithms: ['sha1', 'md5', 'sha512', 'sha256'],
}),
}*/
],
server: {
watch: {
ignored: [
'**/coverage/**',
'**/dist/**',
'**/.vscode/**',
'**/.github/**',
],
},
fs: {
//strict: true,
//deny: ['.env', '.env.*', '**/*.{pem,crt}'],
/*allow: [
'index.html',
'LICENSE',
'package.json',
'tsconfig*.json',
'src/** /*',
'public/** /*',
'** /node_modules/** /*',
],*/
},
},
build: {
target: 'esnext',
polyfillDynamicImport: false,
assetsDir: 'static',
assetsInlineLimit: 512,
sourcemap: true,
},
cacheDir: 'node_modules/.cache/vite',
});