VUE打包环境部署
安装拓展源
yum -y install epel-release
安装nodejs及npm
yum -y install nodejs npm
配置npm源
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
安装pnpm
npm install -g pnpm
安装项目所需插件
cd xxx项目目录
npm install ##或者 pnpm install
打包
npm build ##或者 pnpm build
此时目录下会生成dist目录
发布项目
演示为yum安装的nginx
rm -rf /usr/share/nginx/html/*
cp -r dist/* /usr/share/nginx/html/
启动nginx
systemtcl start nginx
访问项目
直接访问IP 若有域名访问域名
评论区