代码拉取完成,页面将自动刷新
同步操作将从 瞌睡游鱼/PathFinding 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
'use strict';
const gulp = require("gulp");
const concat = require("gulp-concat");
const minify = require('gulp-minify');
const fs = require('fs');
const path = require("path");
function readDir(basePath, extension) {
let outs = [];
let files = fs.readdirSync(basePath);
files.forEach((fileName) => {
var fullname = path.join(basePath, fileName);
var stats = fs.statSync(fullname);
if (stats.isDirectory()) {
let childOuts = readDir(fullname, extension);
outs = outs.concat(childOuts);
} else if (extension && fullname.lastIndexOf(extension) != -1) {
outs.push(fullname);
}
})
return outs;
}
const ts = require('gulp-typescript');
const footer = require("gulp-footer");
const gulpIf = require("gulp-if");
const header = require("gulp-header");
const replace = require("gulp-replace");
const sourcemaps = require('gulp-sourcemaps');
let pkg = JSON.parse(fs.readFileSync("./package.json").toString());
var version = pkg.version;
var vTime = Date.now();
let allModule = [];
buildModel("astar", true);
buildModel("jump", true);
gulp.task('default', gulp.series(...allModule));
function buildModel(modelName, isBase) {
let modelProject = ts.createProject(`tsconfig/tsconfig_${modelName}.json`);
gulp.task(modelName, () => {
let tscVinyl = modelProject.src()
.pipe(sourcemaps.init())
.pipe(modelProject())
tscVinyl.dts
.pipe(header(`//版本号${version},编译时间${(new Date()).toString()}\r\n`))
.pipe(gulp.dest("./"))
return tscVinyl.js
.pipe(replace('"use strict";', ''))
.pipe(replace('var PF;', ''))
.pipe(header(isBase ? `PF.version="${version}";PF.vTime=${vTime};` : `PF.${modelName}Ver={"version":"${version}","vTime":${vTime}};`))
.pipe(header(`\'use strict\'\nvar PF = window.PF = window.PF || {};\n`))
.pipe(sourcemaps.write('./'))
.pipe(minify({ ext: { min: ".min.js" } }))
.pipe(gulp.dest("./"))
})
// gulp.task(modelName + "Ts", () => {
// return modelProject.src()
// .pipe(modelProject()).dts
// .pipe(header(`//版本号${version},编译时间${(new Date()).toString()}\r\n`))
// .pipe(gulp.dest("./"));
// });
allModule.push(modelName);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。