Robert Jaros
12/12/2019, 11:37 AMconfig.plugins.push(new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
}));
in webpack.config.d/jquery.js. With new Kotlin/JS plugin it fails with an error:
webpack.config.js:69
config.plugins.push(new webpack.ProvidePlugin({
^
ReferenceError: webpack is not definedIlya Goncharov [JB]
12/12/2019, 12:46 PMrequire)
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"
}));
})();