0.0.49 • Published 9 months ago

@hattip/bundler-cloudflare-workers v0.0.49

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@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 number

The 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.

0.0.49

9 months ago

0.0.46

1 year ago

0.0.47

11 months ago

0.0.48

10 months ago

0.0.45

1 year ago

0.0.44

1 year ago

0.0.43

1 year ago

0.0.42

1 year ago

0.0.41

1 year ago

0.0.40

1 year ago

0.0.39

2 years ago

0.0.38

2 years ago

0.0.37

2 years ago

0.0.36

2 years ago

0.0.35-canary.2

2 years ago

0.0.35-canary.7

2 years ago

0.0.35-canary

2 years ago

0.0.35

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.20

3 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.9

3 years ago

0.0.16

3 years ago

0.0.8

3 years ago

0.0.17

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago