Add namespace to gulp-rename to make export work

This commit is contained in:
Schmulik Raskin
2016-08-17 23:43:33 +03:00
parent 0ab270c80b
commit 40c950b923
2 changed files with 12 additions and 2 deletions
+4 -1
View File
@@ -3,6 +3,9 @@
import gulp = require("gulp");
import rename = require("gulp-rename");
// Test that new import syntax works
import * as newRename from 'gulp-rename';
// rename via string
gulp.src("./src/main/text/hello.txt")
.pipe(rename("main/text/ciao/goodbye.md"))
@@ -26,4 +29,4 @@ gulp.src("./src/main/text/hello.txt", { base: process.cwd() })
suffix: "-hola",
extname: ".md"
}))
.pipe(gulp.dest("./dist")); // ./dist/main/text/ciao/bonjour-aloha-hola.md
.pipe(gulp.dest("./dist")); // ./dist/main/text/ciao/bonjour-aloha-hola.md
+8 -1
View File
@@ -20,5 +20,12 @@ declare module "gulp-rename" {
function rename(name: string): NodeJS.ReadWriteStream;
function rename(callback: (path: ParsedPath) => any): NodeJS.ReadWriteStream;
function rename(opts: Options): NodeJS.ReadWriteStream;
/**
* This is required as per:
* https://github.com/Microsoft/TypeScript/issues/5073
*/
namespace rename {}
export = rename;
}
}