diff --git a/src/index.js b/src/index.js index 6d0c576e0b..4a1e8f1ffe 100644 --- a/src/index.js +++ b/src/index.js @@ -18,6 +18,10 @@ * @copyright 2015, Brandon Jones, Colin MacKenzie IV * @license MIT * + * JQuery + * @copyright jQuery Foundation and other contributors + * @license MIT + * * earcut * @copyright 2016, Mapbox * @license ISC @@ -66,8 +70,13 @@ module.exports = $.extend({ sha: require('./sha'), util: require('./util'), + jQuery: $, d3: require('./d3'), gl: require('./gl'), canvas: require('./canvas'), gui: require('./ui') }, require('./registry')); + +if (window && !window.$) { + window.$ = $; +} diff --git a/src/vendor.js b/src/vendor.js index af90e0ec64..99db4b7f47 100644 --- a/src/vendor.js +++ b/src/vendor.js @@ -1,17 +1,11 @@ // License headers that will be preserved in distributed bundles. -/** - * JQuery - * @copyright jQuery Foundation and other contributors - * @license MIT - */ /** * d3 * @copyright 2010-2016, Michael Bostock * @license BSD-3-Clause */ var globals = { - d3: require('d3'), - $: require('jquery') + d3: require('d3') }; module.exports = globals; diff --git a/webpack.config.js b/webpack.config.js index 4660366c63..e25ee50d71 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -40,7 +40,6 @@ module.exports = { } }, externals: { - jquery: 'jQuery', d3: 'd3' }, plugins: [