Thanks @malay_dube for the reply! But the thing is I am not using node.js at all but including the file through clientlibs using:
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"><sly data-sly-call="${clientlib.js @ categories='my-categories.base'}"/></sly>
My JS file i...