+ 3

Why is the node js require function being shown on a browser (ie client side)?

Well i was going through some websites source code and i saw a require function ie) its a nodejs api for importing modules. It was listed under the webpack src section, and it had a folder named node_modules which had a bunch of "server side" js syntax !!

14th Oct 2021, 11:36 PM
_Zi_
_Zi_ - avatar
1 Resposta
+ 3
Yes the require function can be used on client side and its possible with some dependencies like browserify, require.js
16th Oct 2021, 9:14 PM
Shanas
Shanas - avatar