Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
/**
 * This is the default babel configuration for Doodle frontend projects.
 * Note: changes to this file affect all projects that depend on it.
 *
 * How to use:
 * Create a babel.config.js file in your project and extend this configuration as
 * shown in the following example.
 *
 * @example
 * // File: web-my-frontend/babel.config.js
 * module.exports = {
 *  extends: require.resolve('@doodle/frontend-config/babel'),
 *  // custom options
 * };
 */

const path = require('path');

module.exports = {
  env: {
    modern: {
      presets: [
        [
          '@babel/preset-env',
          {
            targets: {
              esmodules: true,
            },
            modules: false,
            ignoreBrowserslistConfig: true,
          },
        ],
        ['@babel/preset-react', { useBuiltIns: true }],
      ],
      plugins: [
        [
          'module-resolver',
          {
            root: [path.resolve('src')],
          },
        ],
        '@babel/plugin-proposal-class-properties',
        '@babel/plugin-proposal-optional-chaining',
        '@babel/plugin-proposal-nullish-coalescing-operator',
        '@babel/plugin-syntax-dynamic-import',
      ],
    },
    fallback: {
      presets: [
        [
          '@babel/preset-env',
          {
            useBuiltIns: 'entry',
            corejs: 3,
            targets: {
              chrome: 57,
              firefox: 60,
              safari: 11,
              ie: 11,
              edge: 16,
              opera: 62,
            },
          },
        ],
        ['@babel/preset-react'],
      ],
      plugins: [
        [
          'module-resolver',
          {
            root: [path.resolve('src')],
          },
        ],
        '@babel/plugin-proposal-class-properties',
        '@babel/plugin-proposal-optional-chaining',
        '@babel/plugin-proposal-nullish-coalescing-operator',
        '@babel/plugin-syntax-dynamic-import',
      ],
    },
    test: {
      presets: [
        [
          '@babel/preset-env',
          {
            modules: 'commonjs',
            targets: {
              node: 'current',
            },
          },
        ],
        '@babel/preset-react',
      ],
      plugins: [
        '@babel/plugin-proposal-class-properties',
        '@babel/plugin-proposal-optional-chaining',
        '@babel/plugin-proposal-nullish-coalescing-operator',
        '@babel/plugin-syntax-dynamic-import',
      ],
    },
  },
};