From c76c4f9e0b788abf91501e85cfbf1380ee27c9e4 Mon Sep 17 00:00:00 2001 From: sayan-mitra Date: Fri, 21 Aug 2020 17:46:33 +0530 Subject: [PATCH] add polyfill and other changes --- package.json | 3 +++ rollup.config.js | 18 +++++++++++++++++- utils/logUtil.js | 8 ++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b6cbb4ca48..bc4b26326a 100644 --- a/package.json +++ b/package.json @@ -46,12 +46,14 @@ "after": "^0.8.2", "auto-changelog": "^1.16.2", "babel-eslint": "^10.1.0", + "babel-polyfill": "^6.26.0", "btoa": "^1.2.1", "camelcase": "^6.0.0", "component-cookie": "^1.1.4", "component-each": "^0.2.6", "component-emitter": "github:component/emitter", "component-url": "^0.2.1", + "core-js": "^3.6.5", "crypto-js": "3.1.9-1", "each": "^1.2.2", "fs": "0.0.1-security", @@ -61,6 +63,7 @@ "md5": "^2.2.1", "obj-case": "^0.2.0", "on-body": "0.0.1", + "regenerator-runtime": "^0.13.7", "rudder-component-cookie": "0.0.1", "semver": "^7.1.3", "universal-analytics": "^0.4.20", diff --git a/rollup.config.js b/rollup.config.js index e87bd0bca1..e6a5be0114 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -100,7 +100,23 @@ export default { builtins(), babel({ - presets: [["@babel/env"]], + exclude: ["node_modules/@babel/**", "node_modules/core-js/**"], + presets: [ + [ + "@babel/env", + { + corejs: 3, + useBuiltIns: "usage", + targets: { + edge: "17", + firefox: "60", + ie: "9", + chrome: "67", + safari: "11.1", + }, + }, + ], + ], plugins: [ [ "@babel/plugin-proposal-class-properties", diff --git a/utils/logUtil.js b/utils/logUtil.js index 723c9868c8..2b12bb6b29 100644 --- a/utils/logUtil.js +++ b/utils/logUtil.js @@ -20,25 +20,25 @@ const logger = { info() { if (LOG_LEVEL <= LOG_LEVEL_INFO) { - console.info(...arguments); + console.log(...arguments); } }, debug() { if (LOG_LEVEL <= LOG_LEVEL_DEBUG) { - console.debug(...arguments); + console.log(...arguments); } }, warn() { if (LOG_LEVEL <= LOG_LEVEL_WARN) { - console.warn(...arguments); + console.log(...arguments); } }, error() { if (LOG_LEVEL <= LOG_LEVEL_ERROR) { - console.error(...arguments); + console.log(...arguments); } }, };