How to use babel-plugin-transform-react-remove-prop-types - 10 common examples

To help you get started, we’ve selected a few babel-plugin-transform-react-remove-prop-types 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 facebook / create-react-app / packages / babel-preset-react-app / create.js View on Github external
// https://github.com/babel/babel/issues/10261
          version: require('@babel/runtime/package.json').version,
          regenerator: true,
          // https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules
          // We should turn this on once the lowest version of Node LTS
          // supports ES Modules.
          useESModules,
          // Undocumented option that lets us encapsulate our runtime, ensuring
          // the correct version is used
          // https://github.com/babel/babel/blob/090c364a90fe73d36a30707fc612ce037bdbbb24/packages/babel-plugin-transform-runtime/src/index.js#L35-L42
          absoluteRuntime: absoluteRuntimePath,
        },
      ],
      isEnvProduction && [
        // Remove PropTypes from production build
        require('babel-plugin-transform-react-remove-prop-types').default,
        {
          removeImport: true,
        },
      ],
      // Adds syntax support for import()
      require('@babel/plugin-syntax-dynamic-import').default,
      // Adds syntax support for optional chaining (?.)
      require('@babel/plugin-proposal-optional-chaining').default,
      // Adds syntax support for default value using ?? operator
      require('@babel/plugin-proposal-nullish-coalescing-operator').default,
      isEnvTest &&
        // Transform dynamic import to require
        require('babel-plugin-dynamic-import-node'),
    ].filter(Boolean),
    overrides: [
      isFlowEnabled && {
github SUI-Components / sui / packages / babel-preset-sui / src / index.js View on Github external
function plugins(api, opts = {}) {
  return cleanList([
    require('@babel/plugin-syntax-dynamic-import').default,
    require('@babel/plugin-syntax-export-default-from').default,
    require('@babel/plugin-syntax-export-namespace-from').default,
    require('@babel/plugin-proposal-optional-chaining').default,
    require('@babel/plugin-proposal-nullish-coalescing-operator').default,
    [require('@babel/plugin-proposal-decorators').default, {legacy: true}],
    [require('@babel/plugin-proposal-class-properties').default, {loose: true}],
    [
      require('babel-plugin-transform-react-remove-prop-types').default,
      {
        wrap: true
      }
    ],
    [
      require('@babel/plugin-proposal-object-rest-spread').default,
      {useBuiltIns: true} // asume Object.assign is available by browser or polyfill
    ],
    [
      require('@babel/plugin-transform-runtime').default,
      {
        corejs: false,
        useESModules: true,
        regenerator: true
      }
    ]
github flaviuse / mern-authentication / client / node_modules / babel-preset-react-app / create.js View on Github external
corejs: false,
          helpers: areHelpersEnabled,
          regenerator: true,
          // https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules
          // We should turn this on once the lowest version of Node LTS
          // supports ES Modules.
          useESModules,
          // Undocumented option that lets us encapsulate our runtime, ensuring
          // the correct version is used
          // https://github.com/babel/babel/blob/090c364a90fe73d36a30707fc612ce037bdbbb24/packages/babel-plugin-transform-runtime/src/index.js#L35-L42
          absoluteRuntime: absoluteRuntimePath,
        },
      ],
      isEnvProduction && [
        // Remove PropTypes from production build
        require('babel-plugin-transform-react-remove-prop-types').default,
        {
          removeImport: true,
        },
      ],
      // Adds syntax support for import()
      require('@babel/plugin-syntax-dynamic-import').default,
      isEnvTest &&
        // Transform dynamic import to require
        require('babel-plugin-dynamic-import-node'),
    ].filter(Boolean),
    overrides: [
      isFlowEnabled && {
        exclude: /\.tsx?$/,
        plugins: [require('@babel/plugin-transform-flow-strip-types').default],
      },
      isTypeScriptEnabled && {
github kriasoft / react-app / packages / react-app-tools / config / babel.js View on Github external
{
          useBuiltIns: true,
        },
      ],
      // Polyfills the runtime needed for async/await and generators
      !isEnvNode && [
        require('@babel/plugin-transform-runtime').default,
        {
          helpers: false,
          polyfill: false,
          regenerator: true,
        },
      ],
      isEnvProduction && [
        // Remove PropTypes from production build
        require('babel-plugin-transform-react-remove-prop-types').default,
        {
          removeImport: true,
        },
      ],
      // function* () { yield 42; yield 43; }
      !(isEnvTest || isEnvNode) && [
        require('@babel/plugin-transform-regenerator').default,
        {
          // Async functions are converted to generators by @babel/preset-env
          async: false,
        },
      ],
      // Adds syntax support for import()
      require('@babel/plugin-syntax-dynamic-import').default,
      (isEnvTest || isEnvNode) &&
        // Transform dynamic import to require
github atlascommunity / jira-plugins-groovy / js / webpack.config.js View on Github external
require('@babel/plugin-transform-destructuring'),
                                [
                                    require('@babel/plugin-proposal-class-properties'),
                                    {
                                        loose: true,
                                    }
                                ],
                                [
                                    require('@babel/plugin-proposal-object-rest-spread'),
                                    {
                                        useBuiltIns: true,
                                    }
                                ],
                                !devMode && [
                                    // Remove PropTypes from production build
                                    require('babel-plugin-transform-react-remove-prop-types').default,
                                    {
                                        removeImport: true,
                                    },
                                ],
                            ].filter(it => it)
                        }
                    },
                    {
                        test: /\.less$/,
                        use: [
                            devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
                            'css-loader',
                            {
                                loader: 'less-loader',
                                options: {
                                    noIeCompat: false
github kriasoft / react-app / packages / react-app-tools / config / babel.js View on Github external
corejs: false,
          helpers: areHelpersEnabled,
          regenerator: true,
          // https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules
          // We should turn this on once the lowest version of Node LTS
          // supports ES Modules.
          useESModules,
          // Undocumented option that lets us encapsulate our runtime, ensuring
          // the correct version is used
          // https://github.com/babel/babel/blob/090c364a90fe73d36a30707fc612ce037bdbbb24/packages/babel-plugin-transform-runtime/src/index.js#L35-L42
          absoluteRuntime: absoluteRuntimePath,
        },
      ],
      isEnvProduction && [
        // Remove PropTypes from production build
        require('babel-plugin-transform-react-remove-prop-types').default,
        {
          removeImport: true,
        },
      ],
      // Adds syntax support for import()
      require('@babel/plugin-syntax-dynamic-import').default,
      isEnvTest &&
        // Transform dynamic import to require
        require('babel-plugin-dynamic-import-node'),
    ].filter(Boolean),
    overrides: [
      isFlowEnabled && {
        exclude: /\.tsx?$/,
        plugins: [require('@babel/plugin-transform-flow-strip-types').default],
      },
      isTypeScriptEnabled && {
github rails / webpacker / lib / install / examples / react / babel.config.js View on Github external
[
        require('@babel/plugin-transform-runtime').default,
        {
          helpers: false,
          regenerator: true,
          corejs: false
        }
      ],
      [
        require('@babel/plugin-transform-regenerator').default,
        {
          async: false
        }
      ],
      isProductionEnv && [
        require('babel-plugin-transform-react-remove-prop-types').default,
        {
          removeImport: true
        }
      ]
    ].filter(Boolean)
  }
}
github broadinstitute / single_cell_portal_core / babel.config.js View on Github external
[
        require('@babel/plugin-transform-runtime').default,
        {
          helpers: false,
          regenerator: true,
          corejs: false
        }
      ],
      [
        require('@babel/plugin-transform-regenerator').default,
        {
          async: false
        }
      ],
      isProductionEnv && [
        require('babel-plugin-transform-react-remove-prop-types').default,
        {
          removeImport: true
        }
      ]
    ].filter(Boolean)
  }
}
github calebmer / node_modules / babel-preset-calebmer / react.js View on Github external
module.exports = function preset (context, opts = {}) {
  const production = Boolean(opts.production || process.env.NODE_ENV === 'production')

  return {
    plugins: [
      require('babel-plugin-transform-react-jsx'),
      require('babel-plugin-syntax-jsx'),
      require('babel-plugin-transform-react-display-name'),
      !production && require('babel-plugin-transform-react-jsx-source'),
      !production && require('babel-plugin-transform-react-jsx-self'),
      production && require('babel-plugin-transform-react-inline-elements'),
      production && require('babel-plugin-transform-react-constant-elements'),
      production && require('babel-plugin-transform-react-remove-prop-types').default,
      production && require('babel-plugin-transform-react-pure-class-to-function'),
    ].filter(Boolean)
  }
}

babel-plugin-transform-react-remove-prop-types

Remove unnecessary React propTypes from the production build

MIT
Latest version published 6 years ago

Package Health Score

70 / 100
Full package analysis