From bdee33f3e3f82510f8c347b1bda857fd839794d1 Mon Sep 17 00:00:00 2001 From: Stanislav A Date: Fri, 13 Jan 2023 17:48:38 +0300 Subject: [PATCH] add targets to babel config --- babel.config.js | 12 ++++++++++++ src/redirects/ati-smarttag.js | 4 +--- src/redirects/matomo.js | 8 ++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/babel.config.js b/babel.config.js index 95275ec6..dcff3bfa 100644 --- a/babel.config.js +++ b/babel.config.js @@ -11,11 +11,23 @@ module.exports = (api) => { '@babel/plugin-transform-typeof-symbol', '@babel/plugin-transform-computed-properties', ], + targets: [ + 'last 1 version', + '> 1%', + // ie 11 is dead and no longer supported + 'not dead', + 'chrome >= 55', + 'firefox >= 52', + 'edge >= 15', + 'opera >= 42', + 'safari >= 11', + ], }, ], ], plugins: [ '@babel/plugin-transform-runtime', + '@babel/plugin-transform-arrow-functions', ], }; diff --git a/src/redirects/ati-smarttag.js b/src/redirects/ati-smarttag.js index e4de22a1..4a00ab27 100644 --- a/src/redirects/ati-smarttag.js +++ b/src/redirects/ati-smarttag.js @@ -87,9 +87,7 @@ export function ATInternetSmartTag(source) { const smartTagWrapper = { Tracker: { - Tag() { - return new tag(); // eslint-disable-line new-cap - }, + Tag: tag, }, }; diff --git a/src/redirects/matomo.js b/src/redirects/matomo.js index 8bcf2f21..649c87cc 100644 --- a/src/redirects/matomo.js +++ b/src/redirects/matomo.js @@ -22,12 +22,8 @@ export function Matomo(source) { AsyncTracker.prototype.addListener = noopFunc; const matomoWrapper = { - getTracker() { - return new Tracker(); - }, - getAsyncTracker() { - return new AsyncTracker(); - }, + getTracker: Tracker, + getAsyncTracker: AsyncTracker, }; window.Piwik = matomoWrapper;