1 Star 0 Fork 4

organization_7054167/lcc-gba

forked from Nomat/lcc-gba 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.ts 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
Nomat 提交于 2020-11-08 01:38 . 第一次提交
let gulp = require("gulp");
let ts = require("gulp-typescript");
let sourcemaps = require('gulp-sourcemaps');
let rename = require("gulp-rename");
let uglify = require("gulp-uglify");
let concat = require('gulp-concat');
let clean = require('gulp-clean');
let jsobfuscator = require('gulp-javascript-obfuscator');
let debug = require('gulp-debug');
let notify = require('gulp-notify');
let merge = require('merge2');
let through = require('through2');
let fs=require("fs");
let path=require("path");
let argv = require('yargs').argv;
/**
* 框架ts配置
*/
const framworkTS = ts.createProject({
module : "system",
lib : [ "dom", "es5", "es2015.promise" ],
target : "es5",
experimentalDecorators : true,
skipLibCheck : true,
noImplicitAny : false,
declaration : true,
removeComments : true,
outFile : "lcc-gba.js",
});
/**
* 构建框架
*/
export function buildFramework(cb:Function) {
if(fs.existsSync('framework')){
console.log("buildFramework");
let tsResult = gulp.src([ 'framework/**/*.ts' ])
.pipe(sourcemaps.init())
.pipe(framworkTS());
return merge(
tsResult.js
/*
.pipe(jsobfuscator({
compact: true
}))
.pipe(uglify())
*/
.pipe(sourcemaps.write())
.pipe(gulp.dest('assets/scripts')),
tsResult.dts
/*
.pipe(rename((path)=>{
path.basename = "lcc-" + path.basename;
}))
*/
.pipe(gulp.dest('./'))
);
}else{
console.error("framework sources not found!");
cb();
}
}
/**
* 测试
* @param cb
*/
export function test(cb:Function){
return gulp.src([ '../../@types/**/*.ts', '../../assets/**/*.ts', '!../../assets/packs/**/*.ts' ])
.pipe(debug({title: 'file:'}));
}
/**
* 默认构建
*/
export default function build(cb:Function){
console.log("please select a task:");
console.log(" buildFramework");
cb();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/chess-and-card-games/lcc-gba.git
git@gitee.com:chess-and-card-games/lcc-gba.git
chess-and-card-games
lcc-gba
lcc-gba
master

搜索帮助