Skip to content

Commit af3c72b

Browse files
committed
update gulpfile
1 parent c46c842 commit af3c72b

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

gulpfile.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ gulp.task("clear", function (cb) {
2323
}
2424
});
2525

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

41-
gulp.task("buildts", ["clear"], function () {
41+
gulp.task("compilets", ["clear"], function(){
42+
var tsResult = gulp.src("ts/**/*.ts").pipe(ts({
43+
"module": "amd",
44+
"target": "es5",
45+
"noImplicitAny": true,
46+
"removeComments": true,
47+
"preserveConstEnums": true
48+
//"outDir": "buildOutput/amd"
49+
}));
50+
return tsResult.js.pipe(gulp.dest("buildOutput/amd"));
51+
});
52+
53+
gulp.task("bundlets", ["clear"], function () {
4254
var tsResult = gulp.src("ts/**/*.ts").pipe(ts({
4355
"module": "amd",
4456
"target": "es5",
@@ -50,6 +62,6 @@ gulp.task("buildts", ["clear"], function () {
5062
return tsResult.js.pipe(uglify()).pipe(gulp.dest("."));
5163
});
5264

53-
gulp.task("build", ["buildjs", "buildts"]);
65+
gulp.task("build", ["bundlejs", "compilets", "bundlets"]);
5466

5567
gulp.task("default", ["build"]);

index-ts-src.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<script type="text/javascript" src="require.js"></script>
1010
<script type="text/javascript">
1111
require.config({
12-
baseUrl: "buildOutput",
12+
baseUrl: "buildOutput/amd",
1313
paths: {
14-
world: "amd"
14+
world: "world"
1515
},
1616
waitSeconds: 0
1717
});

0 commit comments

Comments
 (0)