JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 23
  • Score
    100M100P100Q61680F
  • License MIT

Preview and deploy @marko/run apps to Netlify Functions/Edge Functions

Package Exports

  • @marko/run-adapter-netlify

Readme

Marko Run Logo
@marko/run-adapter-netlify

Preview and deploy @marko/run apps to Netlify Functions/Edge Functions

Intallation

npm install @marko/run-adapter-netlify

Usage

For most applications, installing this adapter is all that is needed. Marko Run will automatically discover it and configure it to deploy to Netlify Functions.

Configuration

Netlify applications require a netlify.toml to configure it. This example is a starting point for Marko Run apps deployed to Netlify Functions.

[build]
  command = "marko-run build"
  publish = "dist/public"
  functions = "dist"

Edge Functions

This adapter can be configured to build for Netlify Edge Functions in the application's Vite config.

import { defineConfig } from "vite";
import marko from "@marko/run/vite";
import netlifyAdapter from "@marko/run-adapter-netlify";

export default defineConfig({
  plugins: [
    marko({
      adapter: netlifyAdapter({ edge: true }),
    }),
  ],
});

The netlify.toml will also need to specify the edge edge_functions directory instead of functions.

[build]
  command = "marko-run build"
  publish = "dist/public"
  edge_functions = "dist"