Nuxt.js Framework Guide | DocumentationSkip to content
WP EngineDocumentation

Nuxt.js Framework Guide

Nuxt.js is the most popular open source Vue-based framework. It allows developers to use all the features you need for production in a front-end framework: file-system routing, rendering modes, data fetching, and more. No config needed. Check out their documentation for guides to all these key features. This guide assumes you are using Nuxt 3.

To get started, you can run the following command to create a new Nuxt.js project and the follow the steps in their automatic setup guide:

npx nuxi init <project-name>

After you have created your application, cd into your project directory:

cd <your project directory>

To deploy your project to our Headless Platform, it will need to be available on a remote GitHub, Bitbucket or GitLab repository. The Nuxt.js installation process lets us initialize a local repository for the project.

Create a new remote repository, and then run the following commands to initialize and configure your local and remote repositories:

# Add remote repository
$ git remote add origin https://<your-git-provider>/<username>/<repo>
# Stage all changed files
$ git add -A
# Commit the files to the current branch
$ git commit -m "initial commit"
# Push changes to remote repository
$ git push -u origin main

Our Headless Platform detects that it is a Nuxt.js app and runs the build script in your package.json file. The default output mode for Nuxt is a Node.js server that gets created as a part of the build process. To run this server on our Headless Platform, change your start script in package.json to the following: node .output/server/index.mjs

This will run your Nuxt app in universal rendering mode (server-side rendering and hydration).

To commit these changes to your repository, run the following commands:

# Stage all changed files
$ git add -A
# Commit the files to the current branch
$ git commit -m "update build and start"
# Push changes to remote repository
$ git push -u origin main

Once your project is in your remote repository, you can follow the directions in our getting started guide to deploy your project to our Headless Platform.

Please visit the Nuxt.js documentation for more in depth details on framework features.

There is a known issue when using Nuxt layers. When specifying a subdirectory as the root of a Headless Platform project, the build process cannot access parent directories. The current recommendation is to either reference the layer as a Git repository or via npm package.

Last updated:

WP ENGINE®, VELOCITIZE®, TORQUE®, EVERCACHE®, and the cog logo service marks are owned by WPEngine, Inc.Privacy Policy Service Status Partner Programs

WP Engine is a proud member and supporter of the community of WordPress® users. The WordPress® trademarks are the intellectual property of the WordPress Foundation, and the Woo® and WooCommerce® trademarks are the intellectual property of WooCommerce, Inc. Uses of the WordPress®, Woo®, and WooCommerce® names in this website are for identification purposes only and do not imply an endorsement by WordPress Foundation or WooCommerce, Inc. WP Engine is not endorsed or owned by, or affiliated with, the WordPress Foundation or WooCommerce, Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

·