3 ms·
Yeah, I'm pretty sure that the code you publish to NPM can be different than your client-side script. Shouldn't we just be making two slightly different versio
by firefoxman1 14y ago
Yeah, I'm pretty sure that the code you publish to NPM can be different than your client-side script.
Shouldn't we just be making two slightly different versions?
- shtylman 14y agoThat is the point. You don't need to be making two versions. This has nothing to do with npm even. Just write your code using the commonjs require syntax. When you want client side scripts use one of the many different bundlers which can resolve the requires and turn it into whatever loader style you want (flat time, AMD, custom, etc). This provides much more flexibility and keeps the code free of boilerplate which serves no purpose.