by toastal · 3y ago · 0 comments
FTFY
I vendor everything my webpages need, better to ensure that the webpage always works as long as my server is up. Also means I can download the page and use it offline.
There's zero reason not to trust a CDN if you're using integrity checks. It's just a host on the internet sending you bits.
In JavaScript these days, dependencies are usually loaded from npm so avoiding the bundling step for client-side code would naively mean replacing those dependencies with links to a third-party service like unpkg, which serves code published to npm for the browser.
As others have explained, vendoring in this case would mean shipping those dependencies as part of your application code so they are served from your own domain. Of course at the moment a lot of dependencies will likely simply not work if imported directly from the browser.
And is usually a significant performance loss, since starting a new connection to the CDN domain is quite expensive during first page load.