Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why can't you use npm modules via a CDN like https://unpkg.com/? Add a JS file that downloads whatever package you need and then use them in that JS file? Have your HTML page load that file via a script tag (you can also have the HTML file load the packages in a script tag) and then you're off to the races.


That's what I did before npm came around, but proper package management, hot reload, test runners etc. are creature comforts I'd hate to do without these days. Keeping dependencies up to date when getting them from a CDN is pretty cumbersome.


Gotcha. I bet you could throw a script together that would use the package.json to auto generate script tags to inject in an HTML file.

It's not ideal but I don't think it'd be too hard. This would require though a build step which is what you seem to want to avoid.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: