From f20e45d52e15bf3aed9eb74e9b9d6b534e94f959 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Thu, 23 Aug 2018 08:45:40 -0400 Subject: [PATCH] Change how babel-polyfills are included. --- src/polyfills.js | 1 + src/vendor.js | 2 +- tests/test-common.js | 2 +- tests/test-utils.js | 2 +- webpack.config.js | 4 ++-- 5 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 src/polyfills.js diff --git a/src/polyfills.js b/src/polyfills.js new file mode 100644 index 0000000000..f420f7676e --- /dev/null +++ b/src/polyfills.js @@ -0,0 +1 @@ +require('babel-polyfill'); diff --git a/src/vendor.js b/src/vendor.js index c26d11c15c..b77c00197a 100644 --- a/src/vendor.js +++ b/src/vendor.js @@ -5,7 +5,7 @@ * @license BSD-3-Clause */ -require('babel-polyfill'); +require('./polyfills'); var globals = { d3: require('d3'), diff --git a/tests/test-common.js b/tests/test-common.js index 975beb8190..5b5c2952c8 100644 --- a/tests/test-common.js +++ b/tests/test-common.js @@ -1,7 +1,7 @@ // General utilities that are made available to tests. var $ = require('jquery'); -var geo = require('../src'); +var geo = require('./test-utils').geo; module.exports = { createOsmMap: function (mapOpts, osmOpts, notiles) { diff --git a/tests/test-utils.js b/tests/test-utils.js index 99ab6bee14..ad9cf82b3a 100644 --- a/tests/test-utils.js +++ b/tests/test-utils.js @@ -2,9 +2,9 @@ /* exported waitForIt, closeToArray, closeToEqual, logCanvas2D, submitNote */ /* global CanvasRenderingContext2D */ -require('babel-polyfill'); var $ = require('jquery'); +require('../src/polyfills'); var geo = require('../src'); var bowser = require('bowser'); diff --git a/webpack.config.js b/webpack.config.js index 74b13349c6..4cbfae984a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,7 +3,7 @@ var merge = require('webpack-merge'); module.exports = merge(config, { entry: { - 'geo': './index.js', - 'geo.min': './index.js' + 'geo': ['./polyfills', './index.js'], + 'geo.min': ['./polyfills', './index.js'] } });