Skip to content
Snippets Groups Projects
Select Git revision
  • 4e80f6b26e9337df94760cfe690f2cba1032bd04
  • annotation-on-video default protected
  • demo_ci
  • 3-upstream-01022023
  • master
  • gh3538-captions
  • 16-adapt-for-images-annot
  • 15-api-for-annotations-on-video
  • 15-annotations-on-videos
  • video_for_annotations
  • wip-1-annotations-on-videos
  • 9-videoviewer-tests
  • 9_wip_videotests
  • 6-fix-tests-and-ci
  • _fix_ci
  • wip-webpack-from-git
16 results

babel.config.js

Blame
  • babel.config.js 1.27 KiB
    /*
     * babel.config.js used to support a UMD built version of Mirador that is
     * compatible with IE11 and Edge.
     */
    
    // eslint-disable-next-line func-names
    module.exports = function (api) {
      api.cache(true);
    
      const presets = [
        [
          '@babel/preset-env',
          {
            corejs: 3,
            exclude: ['transform-typeof-symbol'],
            forceAllTransforms: true,
            modules: false,
            useBuiltIns: 'entry',
          },
        ],
        '@babel/preset-react',
      ];
    
      const plugins = [
        'babel-plugin-macros',
        '@babel/plugin-transform-destructuring',
        [
          '@babel/plugin-proposal-class-properties',
          {
            loose: true,
          },
        ],
        [
          '@babel/plugin-proposal-object-rest-spread',
          {
            useBuiltIns: true,
          },
        ],
        [
          '@babel/plugin-transform-runtime',
          {
            corejs: false,
            helpers: false, // Needed to support IE/Edge
            regenerator: true,
          },
        ],
        [
          '@babel/plugin-transform-regenerator',
          {
            async: false,
          },
        ],
        ['transform-react-remove-prop-types',
          {
            ignoreFilenames: ['node_modules'],
            removeImport: true,
          },
        ],
        ['lodash', {
          id: [
            'lodash',
          ],
        },
        ]];
    
      return {
        plugins,
        presets,
      };
    };