You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,18 @@
2
2
3
3
## Unreleased
4
4
5
+
* Better support building projects that use Yarn on Windows ([#3131](https://github.com/evanw/esbuild/issues/3131), [#3663](https://github.com/evanw/esbuild/issues/3663))
6
+
7
+
With this release, you can now use esbuild to bundle projects that use Yarn Plug'n'Play on Windows on drives other than the `C:` drive. The problem was as follows:
8
+
9
+
1. Yarn in Plug'n'Play mode on Windows stores its global module cache on the `C:` drive
10
+
2. Some developers put their projects on the `D:` drive
11
+
3. Yarn generates relative paths that use `../..` to get from the project directory to the cache directory
12
+
4. Windows-style paths don't support directory traversal between drives via `..` (so `D:\..` is just `D:`)
13
+
5. I didn't have access to a Windows machine for testing this edge case
14
+
15
+
Yarn works around this edge case by pretending Windows-style paths beginning with `C:\` are actually Unix-style paths beginning with `/C:/`, so the `../..` path segments are able to navigate across drives inside Yarn's implementation. This was broken for a long time in esbuild but I finally got access to a Windows machine and was able to debug and fix this edge case. So you should now be able to bundle these projects with esbuild.
16
+
5
17
* Preserve parentheses around function expressions ([#4252](https://github.com/evanw/esbuild/issues/4252))
6
18
7
19
The V8 JavaScript VM uses parentheses around function expressions as an optimization hint to immediately compile the function. Otherwise the function would be lazily-compiled, which has additional overhead if that function is always called immediately as lazy compilation involves parsing the function twice. You can read [V8's blog post about this](https://v8.dev/blog/preparser) for more details.
0 commit comments