ag-grid is proud to partner with webpack

ProvidePlugin

new webpack.ProvidePlugin({identifier1: 'module1', /* ... */})
// or
new webpack.ProvidePlugin({identifier1: ['module1', 'property1'], /* ... */})

Automatically loads modules. Whenever the identifier is encountered as free variable in a module, the module is loaded automatically and the identifier is filled with the exports of the loaded module (of property in order to support named exports).

For importing the default export of an ES2015 module, you have to specify the default property of module.

Typical use-cases

Use jQuery

new webpack.ProvidePlugin({
  $: 'jquery',
  jQuery: 'jquery'
})
// in a module
$('#item'); // <= just works
jQuery('#item'); // <= just works
// $ is automatically set to the exports of module "jquery"

Use jQuery with Angular 1

Angular looks for window.jQuery in order to determine whether jQuery is present, see the source code

new webpack.ProvidePlugin({
  'window.jQuery': 'jquery'
})

Use map from Lodash

new webpack.ProvidePlugin({
  _map: ['lodash', 'map']
})

Use Vue.js

new webpack.ProvidePlugin({
  Vue: ['vue/dist/vue.esm.js', 'default']
})

Contributors