Metronic Mega Update!Tailwind 4, React 19, Next.js 15, KtUI, ReUI, eCommerce, User Management Apps and more
Explore Update

Using react typescript version 9.2.0 with rspack or rsbuild?


Hi , I am trying to setup the theme with rsbuild to support easy module federation.
can you give me the proper steps for it, i am currently running into huge errors related to routing setup.
this is the only thing i am not able to figure out.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Rspack is a high-performance bundler that supports React 9.2.0 through manual configuration:

JSX/TSX Support: Rspack uses the SWC transformer to handle .jsx and .tsx files. You can configure this in your rspack.config.mjs file:
rspack.org
+5
rspack.dev
+5
v0.rspack.dev
+5

javascript
Copy
Edit
export default {
module: {
rules: [
{
test: /\.jsx$/,
use: {
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
},
},
},
type: 'javascript/auto',
},
{
test: /\.tsx$/,
use: {
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
},
},
},
type: 'javascript/auto',
},
],
},
};
Fast Refresh: To enable React Fast Refresh, install the necessary plugins:
rspack.dev

bash
Copy
Edit
npm add @rspack/plugin-react-refresh react-refresh -D
Then, configure them in your rspack.config.mjs:
rspack.dev

javascript
Copy
Edit
import ReactRefreshPlugin from '@rspack/plugin-react-refresh';

const isDev = process.env.NODE_ENV === 'development';

export default {
mode: isDev ? 'development' : 'production',
plugins: [
isDev && new ReactRefreshPlugin(),
isDev && new rspack.HotModuleReplacementPlugin(),
],
};
Rsbuild with React 9.2.0
Rsbuild is a build tool that integrates with Rspack and offers a more streamlined setup for React projects:

React Plugin: Install the React plugin:
v0.rsbuild.dev

bash
Copy
Edit
npm add @rsbuild/plugin-react -D
Then, register it in your rsbuild.config.ts:
v0.rsbuild.dev
+1
rspack.dev
+1

typescript
Copy
Edit
import { pluginReact } from '@rsbuild/plugin-react';

export default {
plugins: [pluginReact()],
};
This plugin automatically configures SWC for JSX/TSX transformation and enables React Fast Refresh.
rspack.dev
+1
v0.rspack.dev
+1

TypeScript Support: Rsbuild uses SWC for TypeScript compilation by default. Ensure your tsconfig.json has "isolatedModules": true to align with SWC's module handling.
main--rspack.netlify.app

Recommendation:
For a streamlined setup with minimal configuration, Rsbuild is the preferred choice.

For more control and customization, Rspack offers flexibility but requires manual configuration.



Hi,

We haven't used Metronic with rsbuild yet. Since Vite is popular and defactor setup for most of the user we fully developed Metronic with Vite.

If you provide more info, what issue are you getting maybe we can try to point you out.
Also can you please share does rsbuild require App level changes in the code ? Does it work woth React Router ?

Regards,
Sean


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(