瀏覽代碼

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 年之前
父節點
當前提交
fc3e17d7c4
共有 1 個文件被更改,包括 8 次插入1 次删除
  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" }))