-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
TypeScript Monorepo support? #852
Comments
I'm not familiar with the Lerna and Yarn ecosystems. You'll have to be specific about what isn't working with esbuild. Can you provide a code sample? |
I'll see if I can create a repro repo tomorrow. This is not easily explained. |
I did use esbuild in monorepo,and i donnot need to compile reference package first,all i need todo is to add an source field to package mainfield which points to source file,then configure esbuild bundle mainfieldoptions which resolve source field first |
Got a link where I can see that? |
While playing around with my repro repo, I got it to work when the root tsconfig.json contains Feel free to close this, although mentioning the |
I am currently trying to solve this as well and noticing this seems to be a general ts monorepo problem more than an esbuild problem. I just wanted to share this other repo that I came across that is handling typescript monorepos with a number of different use cases. Maybe we can add an example there for using esbuild. |
Are there situations where TypeScript works but esbuild doesn't? Is there something about tsconfig.json handling? |
I found this on Twitter this morning – In my projects, I just have a node script that starts a service, and then I loop through my |
been using esbuild in a TS monorepo (using Yarn Workspaces) for months now, I never had an issue. And I'm not using any paths trickery in the root tsconfig, this is what it looks like: {
"compilerOptions": {
"module": "esNext",
"target": "es2017",
"moduleResolution": "node",
"sourceMap": false,
"emitDecoratorMetadata": false,
"experimentalDecorators": true,
"esModuleInterop": true,
"removeComments": true,
"noImplicitAny": true,
"declaration": true,
"jsx": "react",
"allowSyntheticDefaultImports": true,
"importHelpers": false,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"incremental": true,
"importsNotUsedAsValues": "preserve",
"composite": true,
"declarationMap": true,
"typeRoots": ["./node_modules/@types", "./types"]
}
} And here's what the tsconfig looks like for most packages: {
"extends": "../../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"paths": {
"~/*": ["src/*"]
}
}
} |
@hardfist Thanks - however I'm using esbuild-runner which doesn't seem to have an option to pass this to esbuild. |
I'm going to close this since it sounds like this something that is custom to specific project setups and is solved through configuration files. If this works with esbuild but not with esbuild-runner, then this sounds like an issue with esbuild-runner not with esbuild. |
I apologize in advance if this has been asked before, but I didn't find anything. I am maintaining a TypeScript monorepo managed with
lerna
andyarn
workspaces, where I write some maintenance scripts in TypeScript.To run these, I currently use ts-node, but that requires the referenced projects to be compiled first. Seems to be the same with
esbuild
and theesbuild-runner
, but I guess there is a way that this should not be necessary.Am I missing something or is this just not possible yet?
The text was updated successfully, but these errors were encountered: