Skip to content

Commit

Permalink
update gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
iSpring committed Oct 18, 2016
1 parent c46c842 commit af3c72b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions gulpfile.js
Expand Up @@ -23,7 +23,7 @@ gulp.task("clear", function (cb) {
}
});

gulp.task("buildjs", ["clear"], function (cb) {
gulp.task("bundlejs", ["clear"], function (cb) {
//return gulp.src("js/**/*.js").pipe(concat("world.js")).pipe(gulp.dest("build"));
//r.js.cmd -o build-config.js
var p = path.join(__dirname, "node_modules/requirejs/bin/r.js");
Expand All @@ -38,7 +38,19 @@ gulp.task("buildjs", ["clear"], function (cb) {
});
});

gulp.task("buildts", ["clear"], function () {
gulp.task("compilets", ["clear"], function(){
var tsResult = gulp.src("ts/**/*.ts").pipe(ts({
"module": "amd",
"target": "es5",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true
//"outDir": "buildOutput/amd"
}));
return tsResult.js.pipe(gulp.dest("buildOutput/amd"));
});

gulp.task("bundlets", ["clear"], function () {
var tsResult = gulp.src("ts/**/*.ts").pipe(ts({
"module": "amd",
"target": "es5",
Expand All @@ -50,6 +62,6 @@ gulp.task("buildts", ["clear"], function () {
return tsResult.js.pipe(uglify()).pipe(gulp.dest("."));
});

gulp.task("build", ["buildjs", "buildts"]);
gulp.task("build", ["bundlejs", "compilets", "bundlets"]);

gulp.task("default", ["build"]);
4 changes: 2 additions & 2 deletions index-ts-src.html
Expand Up @@ -9,9 +9,9 @@
<script type="text/javascript" src="require.js"></script>
<script type="text/javascript">
require.config({
baseUrl: "buildOutput",
baseUrl: "buildOutput/amd",
paths: {
world: "amd"
world: "world"
},
waitSeconds: 0
});
Expand Down

0 comments on commit af3c72b

Please sign in to comment.