Sha256: 39092385320dd0802588b5197dd278e31133845f2949e65e2dd022f92e1e3557

Contents?: true

Size: 1.68 KB

Versions: 63

Compression:

Stored size: 1.68 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 && [
        '@babel/preset-env',
        {
          targets: {
            node: 'current'
          }
        }
      ],
      (isProductionEnv || isDevelopmentEnv) && [
        '@babel/preset-env',
        {
          forceAllTransforms: true,
          useBuiltIns: 'entry',
          corejs: 3,
          modules: false,
          exclude: ['transform-typeof-symbol']
        }
      ]
    ].filter(Boolean),
    plugins: [
      'babel-plugin-macros',
      '@babel/plugin-syntax-dynamic-import',
      isTestEnv && 'babel-plugin-dynamic-import-node',
      '@babel/plugin-transform-destructuring',
      [
        '@babel/plugin-proposal-class-properties',
        {
          loose: true
        }
      ],
      [
        '@babel/plugin-proposal-object-rest-spread',
        {
          useBuiltIns: true
        }
      ],
      [
        '@babel/plugin-transform-runtime',
        {
          helpers: false,
          regenerator: true,
          corejs: false
        }
      ],
      [
        '@babel/plugin-transform-regenerator',
        {
          async: false
        }
      ]
    ].filter(Boolean)
  }
}

Version data entries

63 entries across 63 versions & 12 rubygems

Version Path
activity_notification-2.3.3 spec/rails_app/babel.config.js
activity_notification-2.3.2 spec/rails_app/babel.config.js
activity_notification-2.3.1 spec/rails_app/babel.config.js
activity_notification-2.3.0 spec/rails_app/babel.config.js
wovnrb-3.11.1 docker/rails/TestSite/babel.config.js
wovnrb-3.11.0 docker/rails/TestSite/babel.config.js
wovnrb-3.10.3 docker/rails/TestSite/babel.config.js
wovnrb-3.10.2 docker/rails/TestSite/babel.config.js
wovnrb-3.10.1 docker/rails/TestSite/babel.config.js
wovnrb-3.10.0 docker/rails/TestSite/babel.config.js
activity_notification-2.2.4 spec/rails_app/babel.config.js
wovnrb-3.9.0 docker/rails/TestSite/babel.config.js
wovnrb-3.8.0 docker/rails/TestSite/babel.config.js
wovnrb-3.7.2 docker/rails/TestSite/babel.config.js
wovnrb-3.7.1 docker/rails/TestSite/babel.config.js
wovnrb-3.6.0 docker/rails/TestSite/babel.config.js
activity_notification-2.2.3 spec/rails_app/babel.config.js
wovnrb-3.5.0 docker/rails/TestSite/babel.config.js
wovnrb-3.4.1 docker/rails/TestSite/babel.config.js
wovnrb-3.4.0 docker/rails/TestSite/babel.config.js