3.1.2 • Published 5 years ago

babel-plugin-rintlmg v3.1.2

Weekly downloads
13
License
MIT
Repository
github
Last release
5 years ago

babel-plugin-rintlmg

Babel plugin for transforming compact messages to react-intl (https://github.com/yahoo/react-intl) format

Usage

.babelrc

"plugins": [
  [ "babel-plugin-rintlmg", { messages: true, indexedIds: true } ]
]

How it works

Plugin transforms following code:

import { defineMessages } from 'react-intl'

export default defineMessages({
  string: {
    en: 'String',
    es: 'Cuerda',
  },
  withChildren: {
    title: {
      en: 'Nested title',
      es: 'Título anidado',
    }
  }
})

with plugin option { messages: true } to

import { defineMessages } from 'react-intl';

export default defineMessages({
  string: {
    en: 'String',
    es: 'Cuerda',
    id: 'test.string'
  },
  withChildren: {
    title: {
      en: 'Nested title',
      es: 'Título anidado',
      id: 'test.withChildren.title'
    }
  }
});

and without options to

import { defineMessages } from 'react-intl';

export default defineMessages({
  string: {
    id: 'test.string'
  },
  withChildren: {
    title: {
      id: 'test.withChildren.title'
    }
  }
});
3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.0

7 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.2.0

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago