美文网首页
基于nuxt.js的项目从搭建到部署步骤

基于nuxt.js的项目从搭建到部署步骤

作者: 歪歪闹 | 来源:发表于2020-04-17 18:24 被阅读0次

    一、项目搭建

    1、创建nuxt项目(确保安装了npm)

    # npx create-nuxt-app

    2、他会让你进行一些选择

    Project name  //项目名称

    Project description  //项目描述

    Use a custom server framework  //服务器框架

    Use a custom UI framework  //UI框架

    Use a custom test framework  //测试框架

    Choose rendering mode  //nuxt模式

    Author name //作者名称

    Choose a package manager  // 包管理

    3、运行项目

    # npm run dev

    二、项目安装

    1、拉去项目到服务器

    # git clone

    2、安装依赖

    # npm install

    三、打包部署

    1、打包编译

    # npm run build

    2、使用pm2部署项目(具体命令自行查看https://www.npmjs.com/package/pm2

    # npm install -g pm2

    3、用pm2启动项目

    # pm2 start npm --name "项目名" -- run start

    四、nginx反向代理端口

    1、配置反向代理,修改 nginx.conf 文件

    在server段里面的location添加   proxy_pass  http://ip:端口;

    至此完成整个流程

    相关文章

      网友评论

          本文标题:基于nuxt.js的项目从搭建到部署步骤

          本文链接:https://www.haomeiwen.com/subject/xnayvhtx.html