How to use babel-plugin-react-intl-auto - 1 common examples

To help you get started, we’ve selected a few babel-plugin-react-intl-auto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reworkjs / reworkjs / src / internals / babel / local-babel-preset.js View on Github external
module.exports = function buildPreset(api, opts = {}) {

  const preset = buildGlobalPreset(api, opts);

  const env = process.env.BABEL_ENV || process.env.NODE_ENV;

  preset.presets.push(
    [require('@babel/preset-react').default, {
      development: env !== 'production',
      useBuiltIns: true,
      ...opts['@babel/preset-react'],
    }],
  );

  preset.plugins.push(
    [require('babel-plugin-react-intl-auto').default, {
      ...opts['babel-plugin-react-intl-auto'],
    }],
    // TODO react-loadable-plugin
  );

  // only remove prop-types locally. Removing on node_modules is known to cause issues
  // on libraries such as https://github.com/SaraVieira/react-social-sharing/blob/master/src/buttons/factory.js#L30
  if (env === 'production') {
    preset.plugins.push(
      [require('babel-plugin-transform-react-remove-prop-types').default, {
        mode: 'remove',
        removeImport: true,
        ...opts['babel-plugin-transform-react-remove-prop-types'],
      }],
    );
  }

babel-plugin-react-intl-auto

i18n for the component age. Auto management react-intl ID

MIT
Latest version published 5 years ago

Package Health Score

53 / 100
Full package analysis

Popular babel-plugin-react-intl-auto functions