Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression 3.7.2 : Build with Project References ignore prepend: false when compileonsave is true and outfile #35393

Closed
Outlivier opened this issue Nov 27, 2019 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@Outlivier
Copy link

Search Terms: Project references prepend composite

Description

In Visual Studio 2019, with nuget package Microsoft.TypeScript.MSBuild.3.7.2, and <TypeScriptBuildMode>true</TypeScriptBuildMode> in .csproj file, with the following structure :

FolderA
    A.ts
    tsconfig.json
FolderB
    B.ts
    tsconfig.json
  • A.ts
let a: number = 15;
  • FolderA\tsconfig.json
{
	"compileOnSave": true,
	"compilerOptions": {
		"noImplicitAny": false,
		"noEmitOnError": true,
		"removeComments": false,
		"sourceMap": true,
		"target": "es5",
		"composite": true,
		"declarationMap": true,
		"declaration": true,
		"outFile": "../file-a.js"
	},
	"exclude": [
		"node_modules",
		"wwwroot"
	]
}
  • B.ts
let b: number = a + 15;
  • FolderB\tsconfig.json
{
	"compileOnSave": true,
	"compilerOptions": {
		"noImplicitAny": false,
		"noEmitOnError": true,
		"removeComments": false,
		"sourceMap": true,
		"target": "es5",
		"composite": true,
		"declarationMap": true,
		"declaration": true,
		"outFile": "../file-b.js"
	},
	"exclude": [
		"node_modules",
		"wwwroot"
	],
	"references": [
		{ "path": "../FolderA/tsconfig.json", "prepend":  false }
	]
}

Expected behavior:

When Modifing File B.ts, after saving, the output of file-b.js should be

var b = a + 15;

Actual behavior:

The output of FolderA is prepend in file-b.js :

var a = 15;
var b = a + 15;

This behavior doesn't happen if

  • TypeScript version is 3.6.4 instead of 3.7.2.
  • CompileOnSave is false, and we build the project after modifing files.
@sheetalkamat
Copy link
Member

sheetalkamat commented Nov 27, 2019

This is fixed by #35335 and duplicate of #35226

@sheetalkamat sheetalkamat added the Duplicate An existing issue was already created label Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants