Error: Cannot find module '../package.json'.
rm -rf node_modules
npm install
npm run build
$(function() {
var loaded = false;
var target = document.querySelector('#containerWhereLooking');
var innerElement = 'idNewElements';
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
for (var i = mutation.addedNodes.length; i--;) {
if (mutation.addedNodes[i].id == innerElement) {
workerWithNewElement();
loaded = true;
break;
}
}
if (loaded)
observer.disconnect();
});
});
var config = { attributes: true, childList: true, characterData: true }
observer.observe(target, config);
var workWithNewElements = function () {
// work work work ...
};
});