-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
109 lines (105 loc) · 2.4 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import {
vitePlugin as remix,
cloudflareDevProxyVitePlugin as remixCloudflareDevProxy,
} from '@remix-run/dev';
import AutoImport from 'unplugin-auto-import/vite';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig(({ isSsrBuild }) => ({
plugins: [
// cjsInterop({
// // List of CJS dependencies that require interop
// dependencies: ['@rjsf/core', '@rjsf/utils'],
// }),
AutoImport({
imports: [
{
clsx: [['default', 'clsx']],
'@remix-run/cloudflare': [['unstable_defineLoader', 'defineLoader']],
},
{
from: '@tanstack/react-query',
imports: ['useMutation'],
},
{
from: '@remix-run/react',
imports: [
'Link',
'useLoaderData',
'useParams',
'useRevalidator',
'useNavigate',
],
},
{
from: '@hono/zod-validator',
imports: ['zValidator'],
},
{
from: 'zod',
imports: ['z'],
},
{
from: '@remix-run/cloudflare',
imports: ['AppLoadContext'],
type: true,
},
],
dirs: ['./app/components/*', './app/utils/*'],
dts: true,
}),
remixCloudflareDevProxy(),
remix({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
unstable_singleFetch: true,
unstable_fogOfWar: true,
},
}),
tsconfigPaths(),
],
ssr: {
// try to fix bundling issues
noExternal: ['@rjsf/core', '@rjsf/utils'],
target: 'webworker',
},
}));
// import { defineConfig } from 'vite';
// import rakkas from 'rakkasjs/vite-plugin';
// import tsconfigPaths from 'vite-tsconfig-paths';
// import monacoEditorPlugin from 'vite-plugin-monaco-editor';
// import { adapterCloudflarePages } from './src/adapter-cloudflare-pages/adapter-cloudflare-pages';
// export default defineConfig(({ ssrBuild }) => ({
// plugins: [
// tsconfigPaths(),
// rakkas({
// adapter: adapterCloudflarePages,
// // adapter: 'cloudflare-workers',
// }),
// ...(ssrBuild
// ? []
// : [
// monacoEditorPlugin.default({
// languageWorkers: ['editorWorkerService', 'json'],
// }),
// ]),
// {
// name: 'disable-public-files',
// config(config, env) {
// if (env.ssrBuild) {
// return {
// build: {
// copyPublicDir: false,
// },
// };
// }
// },
// },
// ],
// // ssr: {
// // format: "esm",
// // target: "webworker",
// // },
// }));