How to serve javascript files (as third party lib)
I am currently implementing a widget to be embedded as a third party library on websites.
I am developing it with Vanilla Svelte and rollup.js.
This is my rollup config.
Question: how can I serve the bundle.min.js through Cloudflare as a CDN? I am assuming it should be possible with Pages Direct Upload?
Idea is to be able to include the script like this later on:
Would be awesome if someone could point me in the right direction
2 Replies
Hey there! My team currently does this and it's extremely simple. We use the officially supported github actions workflow (https://github.com/cloudflare/pages-action?tab=readme-ov-file#usage). In CI just build your project using whatever build/bundling software you want and then point the action config to the output folder via the
directory
paramGitHub
GitHub - cloudflare/pages-action
Contribute to cloudflare/pages-action development by creating an account on GitHub.
That's sounds super simple! I'll definitely do that. Thanks @ScottF