项目打包基于webpack,当前分支已经运行了yarn eject
,webpack配置需要开发者自行管理。
webpack配置文件位于config/webpack
目录之下。
yarn脚本文件位于script
目录之下。
yarn install
npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
yarn install
yarn start
yarn build
打开package.json
,修改 buildWithPrefix
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js",
"buildWithPrefix": "node scripts/build.js http://cdn.yuzzl.top(你的外链地址)",
"upload": "node scripts/upload.js"
}
执行
yarn buildWithPrefix
此时打包出来的所有js、css、图片(public文件夹内的静态文件除外)等依赖,均指向你的外链地址而不是build
文件夹的根目录。
如果你使用七牛的云存储服务来保存静态文件的话,你可以试试:
打开script/upload.js
, 找到下面内容,按照注释进行修改
// 上传凭证以及配置
const ACCESS_KEY = 'o4fgM7P2lPEyo3已经作废FZ7s_NGdo_xJVNDdKf55apCubX';
const SECRET_KEY = 'YxRkcS8o-GSLMo1已经作废ajWuLjeFxFsMo1WKnOvyrLjB8';
// bucket
const options = {
scope: "yzlyz已经作废l123",
};
// 空间对应的机房
config.zone = uploader.zone.Zone_z2;
带外链打包
yarn buildWithPrefix
执行上传脚本
yarn upload
所有css、js等静态文件会被自动上传至七牛服务器,你只需要将index.html、一些图标文件传上服务器进行托管即可。
请参考这篇文章
服务端:https://github.com/yuzhanglong/YuJudge-JudgeServer
判题机:https://github.com/yuzhanglong/YuJudge-JudgeHost
判题核心:https://github.com/yuzhanglong/YuJudge-Core
最新版本 1.0.0
发布前后端项目至GitHub