gulp-riot-typescript
v0.1.0
Published
gulp plugin for compiling typescript in riot tag with other *.ts files.
Downloads
5
Readme
gulp-riot-typescipt
gulp plugin for compiling typescript in riot tag with other *.ts files.
Install
'gulp-riot-typescipt' is designed to use with gulp-riot. And you need to install your favorite version of 'typescirpt'.
npm install --save-dev gulp-riot-typescipt gulp-riot typescript
Usage
const gulp = require("gulp");
const runSeq = require("run-sequence");
const riot = require("gulp-riot");
const riotTs = require("gulp-riot-typescipt").init("tsconfig.json");
gulp.task("buildTs", function() {
return gulp.src("src/**/*.ts")
.pipe(riotTs.compileTs)
.pipe(gulp.dest("build"));
});
gulp.task("buildTag", function() {
return gulp.src("src/**/*.tag")
.pipe(riot({
parsers: {
js: {"riot-typescript": riotTs.compileTag }
}
}))
.pipe(gulp.dest("build"));
});
gulp.task("build", function(callback) {
// the compiling typescript is required before the
// compiling riot tag files.
return runSeq(
"buildTs",
"buildTag",
callback
);
});
API
init(options: ts.CompilerOptions | string): RiotTypescript
arguments
- options: typescript compiler options object or file path to tsconfig.json. It used for internal typescript language service.
return
- riot typescript object. (see below)
interface RiotTypescript
fields
- compileTs: Function ... gulp plugin function for compiling *.ts files.
- compileTag: Function ... typescript parser function for riot compiler.
License
MIT (c) 2016 runoshun