v0.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
browser
entries inpackage.json
with no file extension (#740)This fix changes how esbuild interprets the
browser
field inpackage.json
. It will now remap imports without a file extension tobrowser
map entries without a file extension, which improves compatibility with Webpack. Specifically, apackage.json
file with"browser": {"./file": "./something.js"}
will now match an import of./file
. Previously thepackage.json
file had to contain something like"browser": {"./file.js": "./something.js"}
instead. Note that for compatibility with the rest of the ecosystem, a remapping of./file
will counter-intuitively not match an import of./file.js
even 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.json
file can become corrupted such that nopostinstall
scripts are run. This bug affects all packages withpostinstall
scripts, not just esbuild, and happens when running npm v7 on apackage-lock.json
file from npm v6 or earlier. It seems like deleting and regenerating yourpackage-lock.json
file is a valid workaround that should get esbuild working again.