-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Prefer .js over .ts causing over-eager rebuilds with watch mode with preserve-symlinks #3579
Comments
I think I'm going to need a reproduction case for this one, sorry. I don't use symlinks heavily myself and can't quite understand the problem you're describing. Please provide instructions and/or sample code to reproduce the problem and describe exactly what you want esbuild to do instead. You may find esbuild's issue reporting instructions helpful:
|
The repro is fortunately quite simple - if you don't mind an artificial repro, e.g., let's ignore the question of "why do you have JS and TS files together" znewsham/test-esbuild#1 - if you look in issue-3579 folder the repro should be pretty easy |
Sorry, I don't understand. This happens both with esbuild 0.17.0 (i.e. before the version 0.18.0 that you mentioned) and with esbuild 0.19.11. That's because
Isn't that because the - "my-package": "^0.0.1"
+ "my-package": "file:../my-package" |
I over-simplified a little, my bad. If you check that PR again you'll be able to repro (and NOT repro in 0.17) Regarding the index.js:
Regarding the |
I'm having some problems with the 0.18.0 change to prefer js over ts files and how it interacts with the
preserveSymlinks
option? I'm experiencing these problems on the latest 0.19 version too.From #3019:
This seems to be saying that when using symlinks, if
--preserve-symlinks
is false, there will be no concerns with the new ts vs js preference, however when true it is expected to cause problems?My problem is that we have locally symlinked node modules that are shared between applications - in a structure a little like this:
Setting
preserveSymlinks: false
causes the build to fail due to missing packages, not just due to missing local packages, but any NPM dependency of a shared package (regardless of whether it's also local and shared or from NPM) causes esbuild to throw a "Could not resolve" error.Setting
preserveSymlinks: true
causes the build to ignore any typescript changes after the initial build (e.g., once esbuild has generated the typescript files).Is there currently any way to workaround this? E.g., tsconfig, or an option for esbuild itself? Would a change in project structure resolve this problem (while still allowing shared local packages)
Would you support detecting that the file exists outside of node_modules regardless of the
preserveSymlinks
setting, or a white/blacklist glob pattern option to prefer ts over js in certain cases?The text was updated successfully, but these errors were encountered: