Code Monkey home page Code Monkey logo

netlify-plugin-nextjs's Introduction

Next.js on Netlify Build Plugin

Essential Next.js Build Plugin

This build plugin is a utility for supporting Next.js on Netlify. To enable server-side rendering and other framework-specific features in your Next.js application on Netlify, you will need to install this plugin for your app.

Table of Contents

Installation and Configuration

For new Next.js sites

As of v3.0.0, all new sites deployed to Netlify with Next.js will automatically install this plugin for a seamless experience deploying Next.js on Netlify!

This means that you don't have to do anything — just build and deploy your site to Netlify as usual and we'll handle the rest.

You're able to remove the plugin at any time by visiting the Plugins tab for your site in the Netlify UI.

For existing Next.js sites

UI Installation

If your Next.js project was already deployed to Netlify pre-3.0.0, use the Netlify UI to install the Essential Next.js Build Plugin in a few clicks.

Manual installation

1. Create a netlify.toml in the root of your project. Your file should include the plugins section below:

[build]
  command = "npm run build"
  publish = "out"

[[plugins]]
  package = "@netlify/plugin-nextjs"

Note: the plugin does not run for statically exported Next.js sites (aka sites that use next export). To use the plugin, you should use the [build] config in the .toml snippet above. Be sure to exclude next export from your build script. The plugin will attempt to detect if the site uses static export or Storybook, and will not run for either. If you want to disable the auto-detection, you can set the NEXT_PLUGIN_FORCE_RUN environment variable to true or false. Setting it to true or 1 will mean the plugin always runs, and setting it to false or 0 will mean it never runs. If unset, auto-detection will be used. This variable should be set in the Netlify UI or in the netlify.toml file.

2. From your project's base directory, use npm, yarn, or any other Node.js package manager to add this plugin to dependencies in package.json.

npm install --save @netlify/plugin-nextjs

or

yarn add @netlify/plugin-nextjs

Read more about file-based plugin installation in our docs.

Docs

Credits

This package extends the project next-on-netlify, authored originally by Finn Woelm.

netlify-plugin-nextjs's People

Contributors

renovate-bot avatar renovate[bot] avatar lindsaylevine avatar ehmicky avatar ascorbic avatar token-generator-app[bot] avatar erezrokah avatar sdras avatar rstavchansky avatar cassidoo avatar verythorough avatar ctemplin avatar eduardoboucas avatar jlengstorf avatar ikristy avatar iryanbell avatar tmilewski avatar tools-netlify avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.