Skip to content

Latest commit

 

History

History
 
 

bundler-netlify

@hattip/bundler-netlify

Hattip bundler for Netlify Functions and Netlify Edge Functions. It uses esbuild behind the scenes.

CLI

hattip-netlify
    Bundle a Hattip app for Netlify

For more info, run any command with the `--help` flag:
  $ hattip-netlify --help

Options:
  -o, --outputDir <path>  Root directory of the app
  -c, --clearOutputDir    Clear the output directory before bundling
  -s, --staticDir <path>  Static directory to copy to output
  -e, --edge <path>       Edge function entry file
  -S, --func <path>       Regular function entry file
  -h, --help              Display this message
  -v, --version           Display version number

The edge function entry should be in the following form:

import netlifyEdgeAdapter from "@hattip/adapter-netlify-edge";
import handler from "./handler.js";

export default netlifyEdgeAdapter(handler);

The regular function entry should be in the following form:

import netlifyFunctionsAdapter from "@hattip/adapter-netlify-functions";
import hattipHandler from "./handler.js";

export const handler = netlifyFunctionsAdapter(hattipHandler);

JavaScript API

🚧 TODO 🚧

Refer to the TypeScript for the time being.