File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
packages/docs/src/pages/guides Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -186,3 +186,22 @@ In `jsconfig.json` or `tsconfig.json` (since Next.js 12.0.4):
186
186
}
187
187
}
188
188
```
189
+
190
+ ### Using Vite
191
+
192
+ Vite use [ ` esbuild ` ] ( https://esbuild.github.io ) to bundle source files.
193
+ [ Per Vite documentation] ( https://vitejs.dev/guide/features.html#jsx ) , configure the pragma project-wide like this:
194
+
195
+ ``` js filename=vite.config.js
196
+ import { defineConfig } from ' vite'
197
+
198
+ export default defineConfig ({
199
+ esbuild: {
200
+ jsxFactory: ' jsx' ,
201
+ jsxInject: ` import { jsx } from 'theme-ui'` ,
202
+ },
203
+ })
204
+ ```
205
+
206
+ ` esbuild ` will use ` theme-ui ` ’s ` jsx ` for every component by programatically injecting ` import { jsx } from 'theme-ui' `
207
+ to the start of every JSX file.
You can’t perform that action at this time.
0 commit comments