JSPM

  • Created
  • Published
  • Downloads 80
  • Score
    100M100P100Q81258F
  • License MIT

Netlify bundler for Hattip

Package Exports

  • @hattip/bundler-netlify
  • @hattip/bundler-netlify/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@hattip/bundler-netlify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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