3 ms·
Imagine if you could just scp your source code tree onto a CDN and it would automatically bundle it based on how clients import it.
by crabmusket 2y ago
Imagine if you could just scp your source code tree onto a CDN and it would automatically bundle it based on how clients import it.
- ericyd 2y agoIsn't this the idea behind CI/CD wotkflows?
- crabmusket 2y agoYes, the difference is I'd like to offload the work of having to think about optimising code delivery.
- shepherdjerred 2y agoThis sounds similar to https://esm.sh/ https://esm.sh/
- curtisblaine 2y agoUnfortunately singleton peer dependencies (like react) are quite complicated with esm.sh. When esm.sh rewrites a module to import react from the cdn, it kinda "decides" which version of react is it at the moment the module is built on the CDN for the first time. That's why react is "special" and gets a stable build in esm.sh (essentially pointing to a fixed version no matter which version you specify): to avoid the dreaded "two copies of react" error.
- crabmusket 2y agoYep definitely. There are a few of these like JSPM that help convert libraries into browser-importable URLs.