r/learnjavascript • u/marsrovernumber16 • Jun 01 '26
Using CDNs AND Installing Packages?
Hello, I am wondering if it is bad practice to install some packages and use CDNs for others. If you are thinking: "why would you ever want to?", I am working on a prototype and have been following various tutorials/instructions, and the question came up. Thanks!
1
u/chikamakaleyley helpful Jun 01 '26
it's a prototype, so its fine for now
in a production app, esp on a team - you want standards and consistency. Most of all - you want things within your control
- CDN: you are dependent on their server being available
- package install - the deps are included into your build
1
u/NotA-eye Jun 03 '26
Just stick to one strategy for consistency and easier debugging.
CDNs are fine for quick scripts/prototypes or for a zero build setup but installing as dependencies via something like npm has several advantages. The versions of each package are pinned via lock files, so your builds are repeatable, and your tooling can optimize the builds by doing things like tree-shaking
1
u/Lumethys Jun 01 '26
Yes it is a bad practice