Skip to content

Commit

Permalink
Document how to change the @jsxImportSource
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger committed Feb 20, 2025
1 parent 76e318b commit f327671
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions packages/docs/docs/overwriting-webpack-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,45 @@ After restarting, you can import `.wasm` files using an import statement.

Add the Webpack override to your [Node.JS API calls as well if necessary](#when-using-bundle-and-deploysite).

### Change the `@jsxImportSource`

```tsx twoslash
import {Config} from '@remotion/cli/config';

Config.overrideWebpackConfig((config) => {
return {
...config,
module: {
...config.module,
rules: config.module?.rules?.map((rule) => {
// @ts-expect-error
if (!rule?.use) {
return rule;
}

return {
// @ts-expect-error
...rule,
// @ts-expect-error
use: rule?.use.map((use) => {
if (!use?.loader?.includes('esbuild')) {
return use;
}
return {
...use,
options: {
...use.options,
jsxImportSource: 'react',
},
};
}),
};
}),
},
};
});
```

### Use legacy babel loader

See [Using legacy Babel transpilation](/docs/legacy-babel).
Expand Down

0 comments on commit f327671

Please sign in to comment.