gulp-typescript icon indicating copy to clipboard operation
gulp-typescript copied to clipboard

Cannot handle empty files array when project reference exists

Open Yesterday17 opened this issue 6 years ago • 0 comments

Expected behavior: It should work as handbook says:

Note that starting with 3.0, it is no longer an error to have an empty files array if you have at least one reference in a tsconfig.json file.

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

Yesterday17 avatar Jan 02 '19 07:01 Yesterday17