File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ solid-relay relay-runtime
2525Install development dependencies:
2626
2727``` package-install-dev
28- relay-compiler @types/relay-runtime vite-plugin-relay-lite
28+ relay-compiler @types/relay-runtime vite-plugin-relay-lite vite-plugin-cjs-interop
2929```
3030
3131## Project Setup
@@ -37,10 +37,15 @@ For SolidStart applications, configure your `app.config.ts`:
3737``` typescript
3838import { defineConfig } from " @solidjs/start/config" ;
3939import relay from " vite-plugin-relay-lite" ;
40+ import { cjsInterop } from " vite-plugin-cjs-interop" ;
4041
4142export default defineConfig ({
4243 vite : () => ({
43- plugins: [relay ()],
44+ plugins: [
45+ relay (),
46+ // required since Relay only gets published in CJS
47+ cjsInterop ({ dependencies: [" relay-runtime" ] }),
48+ ],
4449 }),
4550});
4651```
@@ -53,11 +58,14 @@ For Vite-based applications, configure your `vite.config.ts`:
5358import { defineConfig } from ' vite' ;
5459import solid from ' vite-plugin-solid' ;
5560import relay from ' vite-plugin-relay-lite' ;
61+ import { cjsInterop } from ' vite-plugin-cjs-interop' ;
5662
5763export default defineConfig ({
5864 plugins: [
5965 solid (),
6066 relay (),
67+ // required since Relay only gets published in CJS
68+ cjsInterop ({ dependencies: [" relay-runtime" ] }),
6169 ],
6270});
6371```
You can’t perform that action at this time.
0 commit comments