Frameworks
This page describes commonly used build settings and other configuration tips for popular build tools and project architectures. Your particular settings may be different.
As a framework user, you can also check out common configurations for monorepos, generic JavaScript SPAs, ignoring builds, and using environment variables with frameworks. As a framework author, explore our frameworks API to get started with defining how your framework deploys sites to Netlify. For even more build configuration advice and to ask questions of your own, visit our Support Forums.
# Definitions
The following sections outline the typical build command and publish directory settings for popular frameworks.
- Build command: the command to run to build your site if you are using a static site generator or other build tool. For example,
npm run build
. The build command runs in the Bash shell, allowing you to add Bash-compatible syntax to the command. - Publish directory: directory that contains the deploy-ready HTML files and assets generated by the build. The directory is relative to the base directory, which is root by default (
/
).Only files in the publish directory are deployed
Files and assets located outside of the publish directory won’t be included in site deploys.
# Angular
Our docs provide an overview for using Angular on Netlify, while our blog post First steps using Netlify & Angular includes task-based setup instructions. The typical build settings are as follows. They differ depending on how you’ve set up your project and whether you’re using Scully, the static site generator for Angular.
- For a standard Angular project:
- Build command:
ng build --prod
- Publish directory:
dist/YOUR_PROJECT_NAME
- Build command:
- Using Angular Universal for prerendering:
- Build command:
npm run prerender
- Publish directory:
dist/YOUR_PROJECT_NAME/browser
- Build command:
- Using Scully:
- Build command:
ng build —prod && npm run scully
- Publish directory:
dist/static
- Build command:
# Astro
Our docs provide an overview for using Astro on Netlify. You can also check out our introductory blog post about Astro and SSR. The default build settings are as follows:
- Build command:
astro build
- Publish directory:
dist
# Eleventy
Our docs provide an overview for using Eleventy on Netlify, and we have a Let’s Learn Eleventy blog post with instructions to get started with the framework. The default build settings are as follows:
- Build command:
eleventy
- Publish directory:
_site
# Express
Express apps can be deployed to Netlify using Netlify Functions. Our docs provide an overview for using Express on Netlify. If paired with a frontend, Express apps on Netlify do not need any specific build settings. Netlify packages and bundles your functions automatically during the build process.
# Gatsby
Our docs provide an overview for using Gatsby on Netlify, while the Gatsby docs include task-based instructions for deploying Gatsby sites to Netlify. For apps that use Gatsby Functions or can benefit from build caching, we provide the Essential Gatsby build plugin.
The typical build settings are as follows:
- Build command:
gatsby build
- Publish directory:
public
# Gridsome
The Gridsome docs include instructions for deploying Gridsome to Netlify. The typical build settings are as follows:
- Build command:
gridsome build
- Publish directory:
dist
# Grunt
We automatically provide Grunt for you in the build environment in case your build command references it. We’ll run npm install grunt-cli
for you before running your build command, in case your build command contains the string grunt
. The typical build settings are as follows:
- Build command:
grunt build
- Publish directory:
dist
# Hexo
The Hexo docs include instructions for deploying Hexo to Netlify. The typical build settings are as follows:
- Build command:
hexo generate
- Publish directory:
public
# Hugo
Our docs provide an overview of Hugo on Netlify, while the Hugo docs include task-based instructions for deploying Hugo to Netlify. The typical build settings are as follows:
- Build command:
hugo
- Publish directory:
public
# Hydrogen
Our docs provide an overview of how Hydrogen works on Netlify. The typical build settings are:
- Build command:
npm run build
- Publish directory:
dist/client
# Jekyll
If your site is built with Jekyll, make sure you have a Gemfile and a Gemfile.lock checked into your repository, specifying the Jekyll version you want to use. The typical build settings are as follows:
- Build command:
jekyll build
- Publish directory:
_site
# Middleman
If your site is built with Middleman, make sure you have a Gemfile and a Gemfile.lock checked into your repository, specifying the Middleman version you want to use. The typical build settings are as follows:
- Build command:
middleman build
- Publish directory:
build
# MkDocs
If you’re using MkDocs, make sure to include the dependency in a Pipfile
or requirements.txt
file, specifying version 0.9.0 or above. You may also need to set your Python version. The typical build settings are as follows:
- Build command:
mkdocs build
- Publish directory:
site
# Next.js
Netlify’s build system can build and deploy all types of Next.js apps to our platform. You can learn more about using Next.js on Netlify in our docs.
For Next.js version 10-13.4, the Next.js Runtime (v4) by Netlify supports apps that require server-side rendering. Next.js Runtime enables server-side rendering through serverless functions and unlocks other framework-specific features for your Next.js application on Netlify.
For Next.js version 13.5 and later, the Next.js Runtime v5 by Netlify supports the App Router, next/image
, and more with zero configuration.
For apps that use next export
to generate static HTML, set the NETLIFY_NEXT_PLUGIN_SKIP
environment variable to true
.
The typical build settings are as follows. They differ depending on how your site is generated.
For apps that use server-side rendering and Next.js Runtime:
- Build command:
next build
- Publish directory:
.next
- Build command:
For apps that use static HTML export:
- Build command:
next build && next export
- Publish directory:
out
- Build command:
# Nuxt
You can get an overview in our Nuxt on Netlify doc or read the Nuxt docs for instructions on how to deploy Nuxt 2 and Nuxt 3 on Netlify. The typical build settings are as follows:
- Nuxt 3
- Build command:
nuxt build
- Publish directory:
dist
- Build command:
- Nuxt 2
- Build command:
nuxt generate
- Publish directory:
dist
- Build command:
# React and Create React App
Check out our docs for building on Netlify using these popular React-based frameworks: Gatsby, Next.js, Remix.
You can also get started with our docs about Create React App on Netlify or read the instructions for deploying to Netlify in the Create React App docs. The typical build settings are as follows:
- Build command:
npm run build
oryarn build
- Publish directory:
build
# Remix
Our docs provide all the information you need to deploy a Remix application on Netlify. The typical build settings are as follows.
For projects built with Remix Vite:
- Build command:
remix vite:build
- Publish directory:
build/client
For projects built with the Remix Classic Compiler:
- Build command:
remix build
- Publish directory:
public
# RedwoodJS
The fastest way to deploy a RedwoodJS project on Netlify is to run yarn rw setup deploy netlify
in your terminal at your project’s root directory. This will create a netlify.toml
file that contains all the configuration you need.
For more details, check out the RedwoodJS docs for deploying to Netlify.
# SvelteKit and Svelte
Check out our docs overview for using SvelteKit on Netlify or learn more in the SvelteKit Netlify adapter README. Typical build settings are as follows.
For projects built with SvelteKit:
- Build command:
vite build
- Publish directory:
build
For projects built with Svelte:
- Build command:
npm run build
oryarn build
- Publish directory:
public
# Vite
Check out our docs overview for using Vite on Netlify or learn more in the Vite docs. Typical build settings are as follows:
- Build command:
npm run build
oryarn build
- Publish directory:
dist
# Vue CLI
Our docs provide an overview for using the Vue CLI with Netlify, and you can also learn more in the Vue CLI docs. The typical build settings are as follows:
- Build command:
npm run build
oryarn build
- Publish directory:
dist
# VuePress
The VuePress docs include instructions for deploying VuePress to Netlify. The typical build settings are as follows:
- Build command:
npm run docs:build
oryarn docs:build
- Publish directory:
docs/.vuepress/dist
Did you find this doc useful?
Your feedback helps us improve our docs.