3

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?

Dheeraj Vepakomma
  • 26,870
  • 17
  • 81
  • 104

1 Answers1

1

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

Eld0w
  • 834
  • 6
  • 12