Comment by bilekas
1 day ago
Surely a cdn is more convenient. I don't want to install an entire package manager just to 'install' 2 CSS files.
1 day ago
Surely a cdn is more convenient. I don't want to install an entire package manager just to 'install' 2 CSS files.
A convenient thing about npm is that you automatically get a CDN too.
https://cdn.jsdelivr.net/npm/css-extras@0.3.1/index.css
But if you’re already using npm in your project, as a significant number of front end projects are, it means you can serve them directly rather than requiring an external CDN.
Please, no! https://csswizardry.com/2019/05/self-host-your-static-assets...
Sure, if you don't like Chinese users. The Great Firewall does not like at least some CDNs.
They also happen to be a great attack vector! You and your users are much better off not using them for anything but toys.
Storing your food in the fridge requires an entire fridge (and power, and...)
Your particular circumstances might not require it (maybe you're just temporarily camping or you only store non-perishable food) but that doesn't mean that fridges, in general, are unnecessary or less convenient than just storing food in a cupboard. Even if you only eat in restaurants and you don't need a fridge, the restaurant does.
This being packaged won't prevent it from being delivered from a CDN. It will actually make it easier to automatically deploy all versions to CDNs as they are published, like in https://www.jsdelivr.com/, while being CDN-only is less convenient when you actually need the many affordances that a package manager provides.
If I already have a package manager and do:
And then in my code:
...and I get it versioned in my package.json, cached, available offline, not subject to link rot, automatically inserted in my bundle, processed, minified and with its dead code eliminated... that's surely more convenient than vendoring from a CDN and manually doing all that process (or worse, not doing it at all and just dropping a raw <link> to the CDN in my HTML, with all its drawbacks).