- 项目完毕后运行 npm run build
- 把 static nuxt.config package.json .nuxt 拷贝到服务器
- 执行npm i
- 执行npm run start
后台:(egg)
- 把egg文件夹拖到服务器
- npm i
- npm run dev
package.json配置:
{ "name": "ksproduct", "version": "1.0.0", "description": "My wondrous Nuxt.js project", "author": "hometown", "private": true, "config": { "nuxt": { "host": "0.0.0.0", "port": 3000 } }, "scripts": { "dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server", "build": "nuxt build", "start": "nuxt start", "generate": "nuxt generate" }, "dependencies": { "cross-env": "^5.2.0", "element-ui": "^2.4.11", "koa": "^2.6.2", "mavon-editor": "^2.7.6", "nuxt": "^2.0.0" }, "devDependencies": { "@nuxtjs/axios": "^5.6.0", "axios": "^0.19.0", "nodemon": "^1.18.9" } }