Cartoon rocket flying into space

How to deploy Nuxt on Netlify

Thumbnail

Feb Dao

|

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

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:

Netlify deploy

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

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Comments

  • Allowed HTML tags: <em> <strong> <cite> <blockquote cite> <ul type> <ol start type> <li> <dl> <dt> <dd> <p>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
  • Use [gist:#####] where ##### is your gist number to embed the gist
    You may also include a specific file within a multi-file gist with [gist:####:my_file].

Spread the word