Skip to content
Snippets Groups Projects
Commit 4e80f6b2 authored by Jack Reed's avatar Jack Reed
Browse files

Support IE11 and Edge with default Mirador UMD build

parent bc9c681a
No related branches found
No related tags found
No related merge requests found
/*
* 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', '@babel/preset-react'];
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',
'transform-react-remove-prop-types',
{
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',
......
/**
* Polyfill file used to build Webpack UMD build. These polyfills are needed to
* support both IE and Edge. If you are using Mirador ES imports these will not
* get bundled up.
*/
import 'core-js/stable'; // eslint-disable-line import/no-extraneous-dependencies
import 'url-polyfill/url-polyfill'; // eslint-disable-line import/no-extraneous-dependencies
import 'unfetch/polyfill'; // eslint-disable-line import/no-extraneous-dependencies
......@@ -4,7 +4,7 @@ const TerserPlugin = require('terser-webpack-plugin');
const paths = require('./config/paths');
const babelLoaderConfig = {
include: paths.appSrc, // CRL
include: paths.appPath, // CRL
loader: require.resolve('babel-loader'),
options: {
// Save disk space when time isn't as important
......@@ -14,7 +14,6 @@ const babelLoaderConfig = {
},
test: /\.(js|mjs|jsx)$/,
};
const baseConfig = [
{
entry: './src/index-core.js',
......@@ -31,7 +30,7 @@ const baseConfig = [
},
},
{
entry: './src/index.js',
entry: ['./src/polyfills.js', './src/index.js'],
module: {
rules: [
babelLoaderConfig,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment