esbuild 0.8.40
-
Fix TypeScript parameter decorators on class constructors (#734)
This release fixes a TypeScript translation bug where parameter decorators on class constructors were translated incorrectly. Affected code looks like this:
class Example { constructor(@decorator param: any) {} }This bug has been fixed. In addition, decorators are no longer allowed on class constructors themselves because they are not allowed in TypeScript.
-
Resolve
browserentries inpackage.jsonwith no file extension (#740)This fix changes how esbuild interprets the
browserfield inpackage.json. It will now remap imports without a file extension tobrowsermap entries without a file extension, which improves compatibility with Webpack. Specifically, apackage.jsonfile with"browser": {"./file": "./something.js"}will now match an import of./file. Previously thepackage.jsonfile had to contain something like"browser": {"./file.js": "./something.js"}instead. Note that for compatibility with the rest of the ecosystem, a remapping of./filewill counter-intuitively not match an import of./file.jseven though it works fine in the other direction. -
Warning: npm v7 bug may prevent esbuild installation
This is a warning for people reading these release notes, not a code change. I have discovered a bug in npm v7 where your
package-lock.jsonfile can become corrupted such that nopostinstallscripts are run. This bug affects all packages withpostinstallscripts, not just esbuild, and happens when running npm v7 on apackage-lock.jsonfile from npm v6 or earlier. It seems like deleting and regenerating yourpackage-lock.jsonfile is a valid workaround that should get esbuild working again.