Sha256: c4344de1802a9d9b563ef98c698b9bf01397568d3bf8ff9a405e06e69e43eb7a

Contents?: true

Size: 1.79 KB

Versions: 18

Compression:

Stored size: 1.79 KB

Contents

module.exports = function(api) {
  var validEnv = ['development', 'test', 'production']
  var currentEnv = api.env()
  var isDevelopmentEnv = api.env('development')
  var isProductionEnv = api.env('production')
  var isTestEnv = api.env('test')

  if (!validEnv.includes(currentEnv)) {
    throw new Error(
      'Please specify a valid `NODE_ENV` or ' +
        '`BABEL_ENV` environment variables. Valid values are "development", ' +
        '"test", and "production". Instead, received: ' +
        JSON.stringify(currentEnv) +
        '.'
    )
  }

  return {
    presets: [
      isTestEnv && [
        require('@babel/preset-env').default,
        {
          targets: {
            node: 'current'
          }
        }
      ],
      (isProductionEnv || isDevelopmentEnv) && [
        require('@babel/preset-env').default,
        {
          forceAllTransforms: true,
          useBuiltIns: 'entry',
          modules: false,
          exclude: ['transform-typeof-symbol']
        }
      ]
    ].filter(Boolean),
    plugins: [
      require('babel-plugin-macros'),
      require('@babel/plugin-syntax-dynamic-import').default,
      isTestEnv && require('babel-plugin-dynamic-import-node'),
      require('@babel/plugin-transform-destructuring').default,
      [
        require('@babel/plugin-proposal-class-properties').default,
        {
          loose: true
        }
      ],
      [
        require('@babel/plugin-proposal-object-rest-spread').default,
        {
          useBuiltIns: true
        }
      ],
      [
        require('@babel/plugin-transform-runtime').default,
        {
          helpers: false,
          regenerator: true
        }
      ],
      [
        require('@babel/plugin-transform-regenerator').default,
        {
          async: false
        }
      ]
    ].filter(Boolean)
  }
}

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
bugsnag-6.15.0 features/fixtures/rails6/app/babel.config.js
bugsnag-6.14.0 features/fixtures/rails6/app/babel.config.js
bugsnag-6.13.1 features/fixtures/rails6/app/babel.config.js
bugsnag-6.13.0 features/fixtures/rails6/app/babel.config.js
bugsnag-6.12.2 features/fixtures/rails6/app/babel.config.js
bugsnag-6.12.1 features/fixtures/rails6/app/babel.config.js
bugsnag-6.12.0 features/fixtures/rails6/app/babel.config.js
webpacker-4.0.2 lib/install/config/babel.config.js
webpacker-4.0.1 lib/install/config/babel.config.js
webpacker-4.0.0 lib/install/config/babel.config.js
webpacker-4.0.0.rc.8 lib/install/config/babel.config.js
webpacker-4.0.0.rc.7 lib/install/config/babel.config.js
webpacker-4.0.0.rc.6 lib/install/config/babel.config.js
webpacker-4.0.0.rc.5 lib/install/config/babel.config.js
webpacker-4.0.0.rc.4 lib/install/config/babel.config.js
webpacker-4.0.0.rc.3 lib/install/config/babel.config.js
webpacker-4.0.0.rc.2 lib/install/config/babel.config.js
webpacker-4.0.0.rc.1 lib/install/config/babel.config.js