Sha256: 9da88ad1dff275c6fbc70880fb0a2168c4c7606331bae4af89d3ae4795a555e3
Contents?: true
Size: 1.19 KB
Versions: 12
Compression:
Stored size: 1.19 KB
Contents
const { moduleExists } = require('shakapacker') module.exports = function config(api) { const validEnv = ['development', 'test', 'production'] const currentEnv = api.env() const isDevelopmentEnv = api.env('development') const isProductionEnv = api.env('production') const isTestEnv = api.env('test') if (!validEnv.includes(currentEnv)) { throw new Error( `Please specify a valid NODE_ENV or BABEL_ENV environment variable. 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', { useBuiltIns: 'entry', corejs: '3.8', modules: 'auto', bugfixes: true, exclude: ['transform-typeof-symbol'] } ], moduleExists('@babel/preset-typescript') && [ '@babel/preset-typescript', { allExtensions: true, isTSX: true } ] ].filter(Boolean), plugins: [ ['@babel/plugin-transform-runtime', { helpers: false }] ].filter(Boolean) } }
Version data entries
12 entries across 12 versions & 1 rubygems