You just need to “import” this package (in fact in js world it will be
require
)
You need add to begin of your js file next
const webpack = require('webpack')
Additionally, if you do that you require
webpack
, but we append all scripts in one js config
If other script require
webpack
too, you can get error with duplicated declaration. To avoid it you can define module
;(function() {
const webpack = require('webpack')
config.plugins.push(new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
}));
})();