运维替换文件

打包分别有 3 种模式

npm run build:dev      # 开发环境
npm run build:test     # 测试环境
npm run build:master   # 生成环境

替换配置也有 3 种模式

根目录下.env.dev,.env.test,.env.master,分别替换服务地址

# 如果多项目配置在同一域名下需要配置项目的文件路径
VUE_APP_BASE_URL=/ # 项目文件路径 配合nginx设置

VUE_APP_SUBSYSTEM=http://ex-dev-dcxy-static.168cad.top # 子项目部署地址
VUE_APP_SYSTEM_SERVER_URL=http://ex-dev-dcxy-system-manage.168cad.top   # 系统管理接口
VUE_APP_CUSTOMER_SERVER_URL=http://ex-dev-customer-manage.168cad.top    # 会员系统接口
VUE_APP_BASE_SERVER_URL=http://ex-dev-dcxy-base-manage.168cad.top       # 基础服务接口
VUE_APP_BASE_SERVER_URL_APP=http://ex-dev-dcxy-base-app.168cad.top      # 基础服务APP接口

Build Setup

# install dependencies
npm install

# build for production with minification
npm run build:{mode}

# build for production and view the bundle analyzer report
npm run build --report

For a detailed explanation on how things work, check out the guide and docs for vue-loader.