straighten up ts compilation

This commit is contained in:
Philipp Kunz 2016-02-19 01:24:25 +01:00
parent 2730ca4299
commit 6227e47037
4 changed files with 9 additions and 24 deletions

View File

@ -167,20 +167,15 @@ var NpmtsCompile;
return plugins.path.join(paths.cwd, config.ts[key]); return plugins.path.join(paths.cwd, config.ts[key]);
} }
})(); })();
var tsStream = plugins.gulp.src([plugins.path.join(paths.cwd, key), "!**/typings/**"]) var stream = plugins.gulp.src([plugins.path.join(paths.cwd, key), "!**/typings/**"])
.pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated .pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated
.pipe(plugins.g.typescript({ .pipe(plugins.g.typescript({
out: outputName, out: outputName,
declaration: true,
target: "ES5", target: "ES5",
module: "commonjs" module: "commonjs"
})); }))
var stream = plugins.mergeStream([
//tsStream.dts.pipe(plugins.gulp.dest(outputDir)),
tsStream.js
.pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file .pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file
.pipe(plugins.gulp.dest(outputDir)) .pipe(plugins.gulp.dest(outputDir));
]);
moduleStream.add(stream); moduleStream.add(stream);
} }
moduleStream.on("queueDrain", function () { moduleStream.on("queueDrain", function () {

View File

@ -30,7 +30,6 @@
"fs-extra": "^0.26.5", "fs-extra": "^0.26.5",
"gulp": "3.9.1", "gulp": "3.9.1",
"gulp-coveralls": "^0.1.4", "gulp-coveralls": "^0.1.4",
"gulp-header": "^1.7.1",
"gulp-istanbul": "^0.10.3", "gulp-istanbul": "^0.10.3",
"gulp-mocha": "^2.2.0", "gulp-mocha": "^2.2.0",
"gulp-sourcemaps": "^1.6.0", "gulp-sourcemaps": "^1.6.0",

View File

@ -1,4 +0,0 @@
/// <reference path="typings/main.d.ts" />
declare var testplugin: {
logSomething: () => void;
};

View File

@ -67,21 +67,16 @@ module NpmtsCompile {
} }
})(); })();
var tsStream = plugins.gulp.src([plugins.path.join(paths.cwd,key),"!**/typings/**"]) var stream = plugins.gulp.src([plugins.path.join(paths.cwd,key),"!**/typings/**"])
.pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated .pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated
.pipe(plugins.g.typescript({ .pipe(plugins.g.typescript({
out: outputName, out: outputName,
declaration: true,
target: "ES5", target: "ES5",
module: "commonjs" module: "commonjs"
})); }))
var stream = plugins.mergeStream([
//tsStream.dts.pipe(plugins.gulp.dest(outputDir)),
tsStream.js
.pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file .pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file
//.pipe(plugins.g.header('#!/usr/bin/env node\n\n')) //.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest(outputDir)) .pipe(plugins.gulp.dest(outputDir));
]);
moduleStream.add(stream); moduleStream.add(stream);
} }
moduleStream.on("queueDrain",function(){ moduleStream.on("queueDrain",function(){