代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/Talk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const path = require("path");
const json = require("comment-json");
const fs = require("fs");
const del = require("del");
const gulp = require("gulp");
const ts = require("gulp-typescript");
const sourcemaps = require("gulp-sourcemaps");
const babel = require("gulp-babel");
const generateTypescriptTypes = require("./scripts/generateSchemaTypes");
const _ = require("lodash");
// Parse the tsconfig.json file (which contains comments).
const tsconfig = json.parse(fs.readFileSync("./src/tsconfig.json").toString());
// Create the typescript project.
const tsProject = ts.createProject("./src/tsconfig.json");
const resolveDistFolder = (...paths) => "./" + path.join("dist", ...paths);
gulp.task("clean", () => del([resolveDistFolder()]));
gulp.task("server:schema", () => generateTypescriptTypes());
gulp.task("server:scripts", () =>
gulp
.src(
[
"./src/**/*.ts",
"./src/**/.*.ts",
// Exclude client files from this, that's for webpack.
"!./src/core/client/**/*.ts",
"!./src/core/client/**/.*.ts",
],
{ base: "src" }
)
.pipe(sourcemaps.init())
.pipe(tsProject())
.pipe(
babel({
plugins: [
[
"module-resolver",
{
root: [resolveDistFolder()],
alias: _.reduce(
tsconfig.compilerOptions.paths,
(alias, [pathGlob], prefixBlob) => ({
...alias,
[prefixBlob.replace(/\/\*/g, "")]: pathGlob
.replace(/\/\*/g, "")
.replace(/^\./g, resolveDistFolder()),
}),
{}
),
},
],
],
})
)
.pipe(sourcemaps.write(".", { sourceRoot: "../src" }))
.pipe(gulp.dest(resolveDistFolder()))
);
gulp.task("server:static", () =>
gulp
.src(["./src/core/server/**/*", "!./src/core/server/**/*.ts"])
.pipe(gulp.dest(resolveDistFolder() + "/core/server"))
);
gulp.task("locales", () =>
gulp
.src(["./src/locales/**/*"])
.pipe(gulp.dest(resolveDistFolder() + "/locales"))
);
gulp.task(
"server",
gulp.series(
"server:schema",
gulp.parallel("server:scripts", "server:static", "locales")
)
);
gulp.task("default", gulp.series("clean", "server"));
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。