Deploying a Static Nuxt.js App with ZEIT Now
Create and deploy your static Nuxt.js app with ZEIT Now.
Nuxt.js is an open-source Vue.js-based framework that provides multiple different rendering modes, one of which allows you generate a static app.
In this guide, you will learn how to create and deploy a Nuxt.js app with ZEIT Now.
Create and deploy a new Nuxt.js project with ZEIT Now without the setup using the button below.
Step 1: Set Up Your Nuxt.js Project
The first step in setting up your new Nuxt.js project is to generate it with create-nuxt-app
:
npm init nuxt-app my-nuxt-app
When asked which rendering mode you want to use, select Single Page App.
With your Nuxt.js project initialized, move into the directory:
cd my-nuxt-app
Before deploying with ZEIT Now, provide Nuxt.js with instructions on which directory the build should be output to. Add the following to your nuxt.config.js
file:
{ ... "generate": { "dir": "public" } }
Following that, change the build script in the package.json
file to the following:
{ "scripts": { ... "build": "nuxt generate" } }
Step 2: Deploying Your Nuxt.js Project With ZEIT Now
With your Nuxt.js app set up, it is ready to be deployed with ZEIT Now.
If you have not yet installed ZEIT Now, you can do so by installing Now CLI.
You are now ready to deploy your app with a single command:
now
Once the app is deployed, you will receive a deployment URL similar to the following: https://nuxt-4l3gekrti.now.sh/