The pages are being serviced by an application JavaScript file that calls for help in a modular way.
layout.pug, javascripts/site.js
'use strict';
import {$} from './modules/nQuery.js';
// more imports
const doSomething = function () {
// to do
}
const init = function () {
if ($('putItHere')) { // on the right page
doSomething();
}
};
window.addEventListener('load', init);