-
配置后端环境(略)
-
安装 Git:
yum install git
-
在服务器上安装 node: https://nodejs.org/dist/v4.2.1/
-
从仓库中拉取项目
git clone git@git.corp.qihoo.net:g-platform-dev/private-cloud-fe.git
并切换到develop
分支$ cd private-cloud-fe $ git checkout develop
-
进入项目页添加 nginx 配置文件并添加文件到
.gitignore
中:$ cd src/nginx $ cp lizheming.cloud.cn.conf yourname.conf # 修改 yourname 为你的文件名 $ vi yourname.conf # 修改 server_name 和 root 为对应的地址,其中 root 需要指定到 provate-cloud-fe/dist 文件夹
-
修改
private-cloud-fe/src/common/request/index.js
中的第 4 行地址为配置好的后端地址并将此文件添加到.gitignore
中 -
安装所需要的依赖并编译:
$ cd private-cloud-fe $ npm install --registry=https://registry.npm.taobao.org $ npm run dist
-
将 nginx 配置文件软链到 NGINX 配置文件夹中:
ln -s /home/lizheming/private-cloud-fe/dist/nginx/yourname.conf /usr/local/nginx/conf/yourname.conf
-
重启 NGINX 服务
如果是 Windows 环境安装 node-sass 之前需要安装 VS Express
npm install --registry=https://registry.npm.taobao.org --verbose
npm run build
npm run buildmin
npm run dist
npm start
npm startdist
后者和前者的区别是startdist会进行压缩并单独拷贝到dist目录,和线上环境最接近
jquery
bootstrap
react
react-router
react-boostrap