forked from mobilemancer/TypeScript_VS_Code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
35 lines (29 loc) · 903 Bytes
/
gulpfile.js
File metadata and controls
35 lines (29 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var gulp = require('gulp'),
ts = require('gulp-typescript'),
merge = require('merge'),
fs = require("fs");
eval("var project = " + fs.readFileSync("./project.json"));
var paths = {
npm: './node_modules/',
lib: "./" + project.webroot + "/lib/",
tsSource: './TypeScript/**/*.ts',
tsOutput: "./" + project.webroot + '/scripts/',
tsDef: "./TypeScript/definitions/"
};
var tsCompilerConfig = ts.createProject({
declarationFiles: true,
noExternalResolve: false,
module: 'AMD',
removeComments: true
});
gulp.task('ts-compile', function () {
var tsResult = gulp.src(paths.tsSource)
.pipe(ts(tsCompilerConfig));
return merge([
tsResult.dts.pipe(gulp.dest(paths.tsDef)),
tsResult.js.pipe(gulp.dest(paths.tsOutput))
]);
});
gulp.task('watch', ['ts-compile'], function () {
gulp.watch(paths.tsSource, ['ts-compile']);
});