gulp-typescript
gulp-typescript copied to clipboard
Cannot handle empty files array when project reference exists
Expected behavior: It should work as handbook says:
Note that starting with 3.0, it is no longer an error to have an empty
filesarray if you have at least onereferencein atsconfig.jsonfile.
Actual behavior:
Error: Invalid glob argument:
Your gulpfile:
Full gulpfile.js here.
function compile(buildNls) {
const tsProject = ts.createProject(`./tsconfig.json`);
let r = tsProject
.src()
.pipe(sourcemaps.init())
.pipe(tsProject())
.js.pipe(buildNls ? nls.rewriteLocalizeCalls() : es.through())
.pipe(
buildNls
? nls.createAdditionalLanguageFiles(languages, "i18n", "out")
: es.through()
);
if (inlineMap && inlineSource) {
r = r.pipe(sourcemaps.write());
} else {
r = r.pipe(
sourcemaps.write("../out", {
// no inlined source
includeContent: inlineSource,
// Return relative source map root directories per file.
sourceRoot: "../src"
})
);
}
return r.pipe(gulp.dest(outDest));
}
tsconfig.json https://github.com/Yesterday17/ZenScript/blob/master/tsconfig.json
{
"files": [],
"include": [],
"references": [
{
"path": "./client"
},
{
"path": "./server"
}
]
}
Code Repository here: https://github.com/Yesterday17/ZenScript