Just started using webpack-2 and have a question about global functions. Have these functions in js file named showPictures.js
:
function isEmpty(el) {
var result = !$.trim(el.html());
return result;
}
function showPicturesList() {
if (!isEmpty($('#picture-name-list'))) {
var pictureList = document.getElementById("added-pictures");
pictureList.style.visibility = 'visible';
}
}
And I have another file util.js
in witch I am calling showPicturesList()
function
window.onload = function(){
showPictureList();
}
Simply using js I would import both scripts into my html, but with webpack I can make one file for both of them so webpack.config.js
I added both of these files as entry
array.
My output file bundle.js
looks as it should it has both of those files inside of it. The question is what would be the easiest way with minimal changes on js files to call showPictureList()
function from utils.js
file?