@hattip/bundler-cloudflare-workers v0.0.49
@hattip/bundler-cloudflare-workers
Hattip bundler for Cloudflare Workers. It uses esbuild behind the scenes.
CLI
hattip-cloudflare-workers [...options] <input> <output>
Bundle the Hattip app in <input> into <output> as a Clourflare Workers module.
Options:
  -e, --entry    Interpret <input> as a Cloudflare Workers module entry instead of a Hattip handler entry
  -h, --help     Display this message
  -v, --version  Display version numberThe input can be either a module that default exports a Hattip handler entry or a Cloudflare Workers module similar to the following:
import cloudflareWorkersAdapter from "@hattip/adapter-cloudflare-workers";
import handler from "./handler.js";
export default {
  fetch: cloudflareWorkersAdapter(handler),
};The output is a Clourflare Workers bundle that can be deployed with wrangler or tested with wrangler dev.
JavaScript API
import bundler from "@hattip/bundler-cloudflare-workers";
// You can specify either `cfwEntry` or `handlerEntry` but not both.
bundler({
  // cfwEntry: "entry-cloudflare-workers.js",
  handlerEntry: "./handler.js",
  output: "./cfw-bundle.js",
}).then(() => {
  console.log("Bundle complete");
});The bundling function also accepts a second argument, a callback that is called with an esbuild options object for customizing the build.
12 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago