Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatjs / react-intl with Vite

Formatjs provides a babel plugin for modules that use react-intl to inject message IDs and remove description. How can I use it with Vite?

like image 698
Dheeraj Vepakomma Avatar asked Sep 01 '25 10:09

Dheeraj Vepakomma


1 Answers

If you're using @vitejs/plugin-react, you can specify a .babelrc or a babel.config.js.

import React from '@vitejs/plugin-react'

...

plugins: [
  React({
    babel: {
      babelrc: true
    }
  }),

  ...

]

https://www.npmjs.com/package/@vitejs/plugin-react

like image 109
Eld0w Avatar answered Sep 04 '25 09:09

Eld0w