kalamuna / twig-drupal-filters

Twig.js implementations of Drupal's Twig filters
8 stars 16 forks source link

IE11 support #46

Open tommybl opened 3 years ago

tommybl commented 3 years ago

This package does not work on IE11, as it uses unsupported features:

The package should be transpiled into cross-browser supported code using a tool like Babel, before it's published to NPM.

Thanks!

calebtr-metro commented 3 years ago

I was able to get around this by having webpack run this package through babel-loader. In webpack.config.js:

  // IE11
  config.module.rules.push({
    test: /\.js$/,
    include: path.resolve(__dirname, '../node_modules/twig-drupal-filters/'),
    loader: 'babel-loader',
  });

babel.config.js also needed updating:

const sourceType = 'unambiguous';