fix
This commit is contained in:
@ -12,7 +12,16 @@ gulp.task('compileTS', function() {
|
||||
return stream;
|
||||
});
|
||||
|
||||
gulp.task('default',['compileTS'], function() {
|
||||
gulp.task('compileTestTS', function() {
|
||||
var stream = gulp.src('../test.ts')
|
||||
.pipe(gulpTypescript({
|
||||
out: "test.js"
|
||||
}))
|
||||
.pipe(gulp.dest("../../"));
|
||||
return stream;
|
||||
});
|
||||
|
||||
gulp.task('default',['compileTS','compileTestTS'], function() {
|
||||
pr.beautylog.success('Typescript compiled');
|
||||
});
|
||||
|
||||
|
20
ts/index.ts
20
ts/index.ts
@ -1,12 +1,16 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var through = require("through2");
|
||||
var path = require("path");
|
||||
var pr = require("pushrocks");
|
||||
var fs = require("fs");
|
||||
|
||||
module.exports = (jadeTemplate,mojo = undefined) => {
|
||||
|
||||
return through.obj((file, enc, cb) => {
|
||||
|
||||
//run callback function to signal end of plugin process.
|
||||
return cb(null, file);
|
||||
});
|
||||
var smartfile:any = {
|
||||
//read File to string
|
||||
readFileToString: (filePath) => {
|
||||
var fileString;
|
||||
fileString = fs.readFileSync(filePath, "utf8");
|
||||
return fileString;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
module.exports = smartfile;
|
||||
|
2
ts/test.ts
Normal file
2
ts/test.ts
Normal file
@ -0,0 +1,2 @@
|
||||
var smartfile = require("./index.js");
|
||||
console.log(smartfile.readFileToString("./test/mytest.txt"));
|
Reference in New Issue
Block a user