I\'m using Webpack in my application, in which I create two entry points - bundle.js for all my JavaScript files/codes, and vendors.js for all libraries like jQuery and Reac
Edit: Sometimes you want to use webpack simply as a module bundler for a simple web project - to keep your own code organized. The following solution is for those who just want an external library to work as expected inside their modules - without using a lot of time diving into webpack setups. (Edited after -1)
Quick and simple (es6) solution if you’re still struggling or want to avoid externals config / additional webpack plugin config:
inside a module:
const { jQuery: $, Underscore: _, etc } = window;