-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
90 lines (81 loc) · 1.91 KB
/
vite.config.ts
File metadata and controls
90 lines (81 loc) · 1.91 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import { lingui } from '@lingui/vite-plugin';
import { vitePlugin as remix } from '@remix-run/dev';
import { installGlobals } from '@remix-run/node';
import { sentryVitePlugin } from '@sentry/vite-plugin';
import Icons from 'unplugin-icons/vite';
import { defineConfig } from 'vite';
import macrosPlugin from 'vite-plugin-babel-macros';
import dynamicImport from 'vite-plugin-dynamic-import';
import topLevelAwait from 'vite-plugin-top-level-await';
import wasm from 'vite-plugin-wasm';
import tsconfigPaths from 'vite-tsconfig-paths';
declare module '@remix-run/node' {
interface Future {
v3_singleFetch: true;
}
}
installGlobals();
export default defineConfig({
define: {
'process.env': {},
},
plugins: [
wasm(),
dynamicImport({}),
topLevelAwait(),
lingui(),
macrosPlugin(),
Icons({
compiler: 'jsx',
jsx: 'react',
}),
remix({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
v3_singleFetch: true,
v3_lazyRouteDiscovery: true,
},
manifest: true,
ignoredRouteFiles: ['**/*.module.css'],
}),
tsconfigPaths(),
sentryVitePlugin({
org: 'stringke',
project: 'ioio',
}),
],
ssr: {
noExternal: ['react-use'],
},
optimizeDeps: {
include: [
'@lingui/core',
'@lingui/react',
'react-use',
// transform adapter 都需要添加到此处
'js-yaml',
'jsonc-parser',
'java-parser',
'smol-toml',
'json5/lib/parse.js',
'json5/lib/stringify.js',
'typescript',
'generate-schema',
'json-ts',
'json-to-go',
'gofmt.js',
'@walmartlabs/json-to-simple-graphql-schema/lib',
'transform-json-types',
'json_typegen_wasm',
'json-to-zod',
'query-string',
// prettier worker
'prettier',
],
},
build: {
sourcemap: true,
},
});