Documentation navigation
Anybuild documentation

Node Static

Build Node-based frameworks into static output and serve the exported files.

Detection

Node Static recognizes framework dependencies, static export configuration, and known build commands. It is scored before the Node.js provider when the project has static output.

Supported frameworks

The following defaults come from the detected framework. ANYBUILD_STATIC_DIR or the generated static_dir config can override any of them.

FrameworkConfig valueDefault static_dir
Angularangulardist
Assembleassembledist
Astroastrodist
Brunchbrunchpublic
Create React Appcreate-react-appbuild
Docusaurusdocusaurusbuild
Docusaurus (legacy)docusaurus-oldbuild
Eleventyeleventy_site
Emberemberdist
Gatsbygatsbypublic
Harpharpwww
Hexohexopublic
Ionic Angularionic-angularwww
Ionic Reactionic-reactdist
Metalsmithmetalsmithbuild
Next.js static exportnextout
Nuxt 2nuxtdist
Nuxt 3nuxt3.output/public
Parcelparceldist
Polymerpolymerbuild/default
Preactpreactbuild
Remixremixbuild/client
Remix v1 / remix-ssgremix-oldbuild/client
Remix v2 with Viteremix-v2build/client
Remix v2 classicremix-v2-classicpublic
Sanitysanitydist
Sanity v3sanity-v3dist
Storybookstorybookstorybook-static
Stencilstencilwww
Sveltesveltebuild
SvelteKitsveltekitbuild
TanStack Starttanstack-startdist/client
UmiJSumijsdist
Vitevitedist
VitePressvitepressdocs/.vitepress/dist
Vue CLIvuedist
VuePressvuepressdocs/.vuepress/dist

Build and output

The provider selects the package manager, runs the detected build, generate, export, or docs build script, and copies the framework-specific output directory into the shared static artifact.

Configuration

Node Static inherits the build configuration from the Node.js provider configuration and the output and serving configuration from the Static Files provider configuration. Any configuration field or environment variable documented on those pages can also be set for Node Static.

Anybuild
load("//anybuild/tools:node_static.bzl", "nodestatic_build", "nodestatic_config")load("//anybuild/tools:staticfile.bzl", "staticfile_serve")
config = nodestatic_config(    schema = 1,    sws_version = "2.38.0",    static_dir = "dist",    node_package_manager = "npm",    node_framework = "vite",    node_server = "node",    node_build_command = "npm run build",    node_version = "24",)
build = nodestatic_build(config)
staticfile_serve(config, build, name = "site")