Skip to content

API

@ogygia/jumpstart

The server build in a few files, for a fast cold start.

On this page

This page is generated from the package’s own .d.ts files on every build, so the signatures, descriptions and examples below always match the source.

import { … } from '@ogygia/jumpstart';

Exports jumpstart · JumpstartOptions

jumpstart

function

jumpstart(): the server build in a few files, so a cold start reads a few files instead of hundreds. Listed beside ogygia():

plugins: [ogygia(), jumpstart({ external: ['sharp'] }), sveltekit()]

It changes the SSR build only: dependencies are bundled in (noExternal) except the packages in external, the framework and every dependency go in one chunk, and each region registry (a script module that marks region imports) in a chunk of its own, which only a page that imports it loads. The client build and dev are not touched, and pages are served byte for byte as without it. The build prints one line naming each package left outside the bundle, and why.

function jumpstart(options?: JumpstartOptions): [OgygiaPlugin, Plugin];

JumpstartOptions

interface

jumpstart(options).

interface JumpstartOptions {/*…*/}

JumpstartOptions.external

Packages that stay outside the server bundle, by package name ('sharp', '@acme/db'), as Vite's resolve.external takes them. Every other dependency is bundled in. List a package that cannot be bundled: one with a native addon, one that reads files next to its own module (new URL('./data.wasm', import.meta.url), __dirname), or one that must be a single instance across the process. A package listed here is imported from node_modules at run time, so the deploy needs it installed.

external?: readonly string[];