JSPM

babel-plugin-react-intl-2-lingui

1.0.7
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q69873F
  • License MIT

Package Exports

  • babel-plugin-react-intl-2-lingui

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-react-intl-2-lingui) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Install

npm i -D babel-plugin-react-intl-2-lingui

Then put to your .babelrc as plugin as following example:

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-react"
  ],
  "plugins": [
    "babel-plugin-react-intl-2-lingui"
  ]
}

Objective

Just to convert existing react-intl components likes of FormattedMessage to Trans of @lingui package

Simple use case:

In

import { FormattedMessage } from "react-intl";

<FormattedMessage id="Hello world!" defaultMessage="Hello world!" />

Out

import { Trans } from "@lingui/react";

<Trans id="Hello world!" defaults="Hello world!" />