Feb is.me
Back

How to deploy Nuxt on Netlify

01/10/2021 · by Feb Dao
Profile picture of Marc Backes (very handsome) Profile picture of Feb Dao(very handsome)

Deploying to Netlify is a option for getting a statically generated Nuxt.js site online quickly.

Bug, Error, Defect, Failure Explained

First of all, you need to config your nuxt.config.js file with:

buildDir: 'dist',
target: 'static',
generate: {
  fallback: true,
}

Then create a new custom command called deploy in package.json file:

  "scripts": {
    ...
    "deploy": "nuxt build && nuxt generate"
  },

Finally, you need to set up the Netlify build settings like this:

you need to set up the Netlify build settings like this

Please remember to set the Base directory to the nuxt.config.js located folder.

with love by Feb Dao © 2021
built with nuxt