Note: Not relevant anymore. Use the latest version of original imports-loader
This is the fork of original https://github.com/webpack/imports-loader repository. The only difference is that it fixes webpack-contrib#5 issue.
npm install @malykhinvi/imports-loader
Given you have this file example.js
$("img").doSomeAwesomeJqueryPluginStuff();
then you can inject the $
variable into the module by configuring the imports-loader like this:
require("@malykhinvi/imports-loader?$=jquery!./example.js");
This simply prepends var $ = require("jquery");
to example.js
.