vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Don't include service-worker in main tsconfig project

Open mjbvz opened this issue 7 months ago • 3 comments

https://github.com/microsoft/vscode/pull/248262#issuecomment-2870005908

mjbvz avatar May 12 '25 17:05 mjbvz

⚠️ This PR originates from a fork. Due to security restrictions, pipelines from forks are no longer triggered automatically. Learn more.

If the changes appear safe, you can manually trigger the pipeline by commenting /AzurePipelines run.

Thank you!

jakebailey avatar May 12 '25 18:05 jakebailey

@bpasero @jrieken This is more difficult than expect and I don't think I'll have time to get to it this iteration

I think the most correct approach would be to create a new tsconfig.service-worker.json just for the service worker script:

{
	"extends": "./tsconfig.base.json",
	"compilerOptions": {
		"composite": true,
		"outDir": "../out/vs",
		"lib": [
			"ES2022",
			"webworker"
		],
		"types": []
	},
	"files": [
		"./vs/workbench/contrib/webview/browser/pre/service-worker.ts"
	]
}

We can then use project references to make sure this project is compiled as part of the main tsconfig.json project

In my testing this fixed tuning tsc -p src/tsconfig.json but it doesn't work with our custom build pipeline. I'm not sure if there's a way to get it to project references to work with tsb

mjbvz avatar May 23 '25 18:05 mjbvz

tsb doesn't support project references and I don't think it ever will (given real fast compile times are on the horizon). Can't we just create yet another gulp compile task for this?

jrieken avatar May 26 '25 08:05 jrieken

Closing and will try different approach

mjbvz avatar Jul 10 '25 22:07 mjbvz