{"bugs":{"url":"https://github.com/formatjs/formatjs/issues"},"dist":{"shasum":"b95529075a48470e56c2054149dd5d4d1203236d","tarball":"https://registry.npmjs.org/babel-plugin-react-intl/-/babel-plugin-react-intl-5.1.4-alpha.6.tgz","fileCount":13,"integrity":"sha512-4Iu8Z8+BVTSrwfvv6QDrCaPWZIf47y0YSS/iUgCP62OwtqImcAt8zd2sNFemGsUQnMOUYacwb6dTyv2Z7B7qjg==","signatures":[{"sig":"MEYCIQDiWj3E0Jle5H+PXyoEy9fwe5+/drrIuxUGf7kCfnQgOQIhAI/LNz1XmIrWyev85XOn5qMfxLrNpva3ve5MAyFylf2N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":66273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1hh4CRA9TVsSAnZWagAAsbkP/1+nk+BL3R2uMFyrJKmm\n5CmQpMMRa0dhHGf6xOZA8qry6eTVISQX6++MWD8yMSUMuzfJZSnOpIrYBILD\ncLkEmauFU9+pCDpY0/YJy/NUFX0MxPYhoNhtsm3vv5nif7ewW0ZaVqQaXLaz\nRm8OWoxdH5ad0eyxp2ZO1pn8RZVDQsI+6nMnzU87mnYLmmeZGrIwtrh8u3TP\n6qE9lnLvehOupDrNl7imfZ6ixuz8GjHh63BEECwwBOadA8waSzFQQ/rys1ZT\nT5C/Uqv8qx/x1mBPgmrfMJJ9bZYDXf+DApWJjs6AbWLQ67i0ZeC/nWBtdg7k\n56xTMMyjqAfHuiHdsoIxKUVjKOHlkq+5z+i5eHqkNo2Rh71qiEFK2ZU2zwV3\n4F4ZgLiTYhh/Wnjuu9aN6Bl95Xx5JnsPNSFpKAgAQlqnNXj3owYx4rMc9y1E\nPZq8QQej/kWabX2d38Q0YHID8lof0gt0Z2Vn4ikHHE7X04OKa8YjibnonxMN\nLYDkxW3tQhi3le6ngD0VGLjan6Jz2WIxvUY3821ZivlbAyLipWn35prB8X4n\nblIRQRIdPvc2FCX2rodzKwmi0myDx/lCznaqB9FoHg2inE3uSy7pMzKS2Nek\nzCzQoxb3r35Zi7aftDPuCxjcHVafKCPRd9heMp8iFwVqz8oQmLfFdQOFK9iv\nMI3I\r\n=F0b/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"babel-plugin-react-intl","types":"dist/index.d.ts","author":{"name":"Eric Ferraiuolo","email":"edf@ericf.me"},"readme":"# babel-plugin-react-intl\n\nExtracts string messages for translation from modules that use [React Intl][].\n\n## Dependencies\n\n### React Intl\n\nThis Babel plugin works with React Intl v2.x\n\n### Babel\n\n- **3.x** of this plugin works with Babel 7\n- **2.x** works with Babel 6\n- **1.x** works with Babel 5\n\n## Installation\n\n```sh\n$ npm install babel-plugin-react-intl\n```\n\n## Usage\n\n**This Babel plugin only visits ES6 modules which `import` React Intl.**\n\nThe default message descriptors for the app's default language will be extracted from: `defineMessages()`, `<FormattedMessage>`, and `<FormattedHTMLMessage>`; all of which are named exports of the React Intl package.\n\nIf a message descriptor has a `description`, it'll be removed from the source after it's extracted to save bytes since it isn't used at runtime.\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n{\n  \"plugins\": [\n    [\n      \"react-intl\",\n      {\n        \"messagesDir\": \"./build/messages/\"\n      }\n    ]\n  ]\n}\n```\n\n#### Options\n\n- **`messagesDir`**: The target location where the plugin will output a `.json` file corresponding to each component from which React Intl messages were extracted. If not provided, the extracted message descriptors will only be accessible via Babel's API.\n\n- **`extractSourceLocation`**: Whether the metadata about the location of the message in the source file should be extracted. If `true`, then `file`, `start`, and `end` fields will exist for each extracted message descriptors. Defaults to `false`.\n\n- **`moduleSourceName`**: The ES6 module source name of the React Intl package. Defaults to: `\"react-intl\"`, but can be changed to another name/path to React Intl.\n\n- **`overrideIdFn`**: A function with the signature `(id: string, defaultMessage: string, description: string|object) => string` which allows you to override the ID both in the extracted javascript and messages.\n\n- **`removeDefaultMessage`**: Remove `defaultMessage` field in generated js after extraction.\n\n- **`additionalComponentNames`**: Additional component names to extract messages from, e.g: `['FormattedFooBarMessage']`. **NOTE**: By default we check for the fact that `FormattedMessage` & `FormattedHTMLMessage` are imported from `moduleSourceName` to make sure variable alias works. This option does not do that so it's less safe.\n\n- **`extractFromFormatMessageCall`**: Opt-in to extract from `intl.formatMessage` call with the same restrictions, e.g: has to be called with object literal such as `intl.formatMessage({ id: 'foo', defaultMessage: 'bar', description: 'baz'})`\n\n### Via Node API\n\nThe extract message descriptors are available via the `metadata` property on the object returned from Babel's `transform()` API:\n\n```javascript\nrequire('@babel/core').transform('code', {\n  plugins: ['react-intl'],\n}); // => { code, map, ast, metadata['react-intl'].messages };\n```\n\n[react intl]: http://formatjs.io/react/\n","gitHead":"deb124d6bd86cf515b2be60fc9b4d4f0e9b9d907","license":"BSD-3-Clause","scripts":{"test":"cross-env TS_NODE_PROJECT=./tsconfig.json cross-env NODE_ENV=test jest","build":"json2ts -i src/options.schema.json -o src/options.ts && tsc","clean":"rimraf lib test/fixtures/**/actual.json","cover":"npm t -- --coverage"},"_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"homepage":"https://github.com/formatjs/formatjs#readme","keywords":["babel-plugin","react-intl"],"repository":{"url":"git+https://github.com/formatjs/formatjs.git","type":"git"},"_npmVersion":"lerna/3.18.4/node@v10.16.0+x64 (darwin)","description":"Extracts string messages for translation from modules that use React Intl.","directories":{},"maintainers":[{"name":"ericf","email":"eferraiuolo@gmail.com"},{"name":"okuryu","email":"okuryu@okuryu.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"_nodeVersion":"10.16.0","dependencies":{"fs-extra":"^8.0.1","@babel/core":"^7.7.2","schema-utils":"^2.2.0","@types/babel__core":"^7.1.2","@types/schema-utils":"^1.0.0","intl-messageformat-parser":"^3.2.4-alpha.6+deb124d","@babel/helper-plugin-utils":"^7.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"json-schema-to-typescript":"^7.1.0"},"_npmOperationalInternal":{"tmp":"tmp/babel-plugin-react-intl_5.1.4-alpha.6_1574312055786_0.00011777964988968215","host":"s3://npm-registry-packages"},"_id":"babel-plugin-react-intl@5.1.4-alpha.6","version":"5.1.4-alpha.6"}