Ver código fonte

Allow extra declaration inclusion

Setting `library.extraDeclarations` (an array of strings) will concat the provided declarations to the currently built declaration file.
Raanan Weber 7 anos atrás
pai
commit
fc3e17d7c4
1 arquivos alterados com 8 adições e 1 exclusões
  1. 8 1
      Tools/Gulp/gulpfile.js

+ 8 - 1
Tools/Gulp/gulpfile.js

@@ -405,7 +405,14 @@ var buildExternalLibrary = function (library, settings, watch) {
             .pipe(gulp.dest(outputDirectory));
         /*}*/
 
-        var dts = tsProcess.dts
+        let preDts;
+        if (library.extraDeclarations) {
+            preDts = merge2([tsProcess.dts, gulp.src(library.extraDeclarations)])
+        } else {
+            preDts = tsProcess.dts;
+        }
+
+        var dts = preDts
             .pipe(concat(library.output))
             .pipe(replace(referenceSearchRegex, ""))
             .pipe(rename({ extname: ".d.ts" }))