generated from SatooRu65536/tpl-remix-vite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
33 lines (32 loc) · 1.08 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
import { vitePlugin as remix, cloudflareDevProxyVitePlugin as remixCloudflareDevProxy } from '@remix-run/dev';
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineConfig } from 'vitest/config';
import { getLoadContext } from './load-context';
export default defineConfig({
test: {
globals: true,
},
plugins: [
/*
NOTE:
`getLoadContext` などの関数をプロキシに渡すときは, TSConfig の Path Alias が正しく機能しない.
そのため, `remix vite:dev` コマンドの前に `tsx` パッケージの `NODE_OPTIONS` を使って正しくパスを解決するようにした.
see: {@link package.json#scripts.dev}
ref: https://github.com/remix-run/remix/issues/9171#issuecomment-2119120941
*/
tsconfigPaths(),
remixCloudflareDevProxy({ getLoadContext }),
remix({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
v3_singleFetch: true,
v3_lazyRouteDiscovery: true,
},
}),
],
ssr: {
noExternal: ['restyle'],
},
});