Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

gulp-tsb@3 refuses to output js files with allowJs #79

Open
zenorbi opened this issue Aug 9, 2018 · 0 comments
Open

gulp-tsb@3 refuses to output js files with allowJs #79

zenorbi opened this issue Aug 9, 2018 · 0 comments

Comments

@zenorbi
Copy link
Contributor

zenorbi commented Aug 9, 2018

Since gulp-tsb removes the outDir compiler at

delete compilerOptions.outDir; // always emit relative to source file
TypeScript thinks that the output file is the same as the source file and reports as:

[error] Cannot write file '/Users/zenorbi/Desktop/test/src/test.js' because it would overwrite input file.
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.

TypeScript checks for this at https://github.com/Microsoft/TypeScript/blob/b1878e62bfeea57a926185e87449d89f34ba5742/src/compiler/program.ts#L2618 and can be suppressed by adding
options.suppressOutputPathCheck = true;
before

const _builder = builder.createTypeScriptBuilder(config, options);

However this would use internal TypeScript options. Would you accept a PR for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant