Expose modules as global variables.
Install:
npm install --save webpack-config-expose
Add to your webpack.config.babel.js
:
import expose from `webpack-config-expose`;
expose({
// map the global `React` to the local module `react`
react: 'React',
})({
/* existing webpack configuration */
})