cf-worker-pdf-generation
cf-worker-pdf-generation copied to clipboard
Example PDF Worker available here https://pdf.obez.uk/twitter
Workers Webpack & Rollup Examples
Cloudflare Workers allow you to write JavaScript which runs on all of Cloudflare's 160+ global data centers.
- This repo is an example of how to combine multiple files and dependencies to create a Worker using the Webpack or Rollup build tools.
- The sample Worker (
src/index.js) generates a PDF file. - Once you've created your bundle, you can test it without leaving your text editor! Just run
npm run preview url=https://google.com?tz=America/New_York
Dependencies
Instructions
git clone https://github.com/obezuk/cf-worker-aws-fetch.git
cd cf-worker-aws-fetch
npm install
Note: the Rollup config in this project supports Node-style require() and ES6 `import
# Build with Webpack
npm run build
# Build with Rollup (ES6 modules)
npm run rollup
# Build with Rollup (CommonJS)
npm run rollup:cjs
# Build with Rollup (UMD)
npm run rollup:umd
# Open the Workers preview with the built Worker:
npm run preview url=https://www.cloudflare.com