DEV Community

Discussion on: Should I install the package or use the CDN?

Collapse
 
ben profile image
Ben Halpern

I agree with all of this. I'll add that if you can add the npm package and include the library as part of your build with the rest of your code, your code should be cleaner. You can rely on imports instead of global variables.

All-in-all I'd call the CDN a quick and dirty version or a good solution depending on your needs, but when in doubt, make it part of your package.json.

Disclaimer: I'm always uncertain about anything in JS land these days πŸ˜„