From a4f1837c8a45c66253366c7f79bd146e341162d4 Mon Sep 17 00:00:00 2001 From: Albert Arvidsson Date: Fri, 19 May 2017 17:11:35 +0200 Subject: [PATCH 1/3] Replace babel-polyfill with transform-runtime Fixes https://github.com/schmich/instascan/issues/42 --- gulpfile.js | 6 +++++- index.js | 1 - package.json | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index bcebe73c..50a98f72 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,7 +20,11 @@ function build(file) { .transform(babelify, { ignore: /zxing\.js$/i, presets: ['es2015'], - plugins: ['syntax-async-functions', 'transform-regenerator'] + plugins: [ + 'syntax-async-functions', + 'transform-regenerator', + 'transform-runtime' + ] }) .bundle() .pipe(source('instascan.js')); diff --git a/index.js b/index.js index 128d4fc5..78392931 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,3 @@ -require('babel-polyfill'); require('webrtc-adapter'); var Instascan = { diff --git a/package.json b/package.json index 87e86c81..5bd1f27d 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "devDependencies": { "babel-plugin-syntax-async-functions": "^6.8.0", "babel-plugin-transform-regenerator": "^6.9.0", + "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-es2015": "^6.9.0", "babelify": "^7.3.0", "browserify": "^13.0.1", From 29464e92deedafe99b630624c4670495259afb54 Mon Sep 17 00:00:00 2001 From: Albert Arvidsson Date: Fri, 19 May 2017 17:15:15 +0200 Subject: [PATCH 2/3] Remove unneeded babel-polyfill dependency --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 5bd1f27d..82f16fa1 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "vinyl-source-stream": "^1.1.0" }, "dependencies": { - "babel-polyfill": "^6.9.1", "fsm-as-promised": "^0.13.0", "visibilityjs": "^1.2.3", "webrtc-adapter": "^1.4.0" From 0fdcae6d18a4f9a2abf421cfc79d449ca6158b0f Mon Sep 17 00:00:00 2001 From: Albert Arvidsson Date: Sun, 21 May 2017 23:06:34 +0200 Subject: [PATCH 3/3] Add babel-runtime as explicit dependency See instructions: https://babeljs.io/docs/plugins/transform-runtime/ --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 82f16fa1..c06bd389 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "vinyl-source-stream": "^1.1.0" }, "dependencies": { + "babel-runtime": "^6.23.0", "fsm-as-promised": "^0.13.0", "visibilityjs": "^1.2.3", "webrtc-adapter": "^1.4.0"