Note: You cannot deploy a server-side-rendered Nuxt app with Now V2 right now. Please use Now V1 for such apps.
To deploy with ZEIT Now you need to customize package.json
add create a now.json
config.
now-build
script command to package.json
:"scripts": {
...
"now-build": "nuxt build --spa"
}
"scripts": {
...
"now-build": "nuxt generate"
}
now.json
and define builds
{
"version": 2,
"builds": [
{ "src": "package.json", "use": "@now/static-build" }
]
}
now
and enjoy!To deploy with now.sh a package.json
like follows is recommended:
{
"name": "my-app",
"dependencies": {
"nuxt": "latest"
},
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start"
}
}
Then run now
and enjoy!
Note: we recommend putting .nuxt
in .npmignore
or .gitignore
.
Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!