Skip to content
An example of building a Cloudflare Worker with Webpack
JavaScript Shell
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts Initial commit Jun 1, 2018
src Initial commit Jun 1, 2018
.gitignore Add DS_Store to gitignore Jun 1, 2018 Mention cURL dependency Jun 1, 2018
package.json Lock down Webpack version Jun 1, 2018
webpack.config.js Initial commit Jun 1, 2018

Workers Webpack Example

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 build tool.

The actual Worker replaces the content of your site with a Worker which returns the current time in the timezone of the caller's choice.


  • npm
  • jq (for the preview script)
  • cURL (for the preview script)


  • npm install
  • npm run build

To open the Workers preview with the built Worker:

  • npm run preview
You can’t perform that action at this time.