Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
esbuild-wasm
Advanced tools
Changelog
0.18.1
Fill in null
entries in input source maps (#3144)
If esbuild bundles input files with source maps and those source maps contain a sourcesContent
array with null
entries, esbuild previously copied those null
entries over to the output source map. With this release, esbuild will now attempt to fill in those null
entries by looking for a file on the file system with the corresponding name from the sources
array. This matches esbuild's existing behavior that automatically generates the sourcesContent
array from the file system if the entire sourcesContent
array is missing.
Support /* @__KEY__ */
comments for mangling property names (#2574)
Property mangling is an advanced feature that enables esbuild to minify certain property names, even though it's not possible to automatically determine that it's safe to do so. The safe property names are configured via regular expression such as --mangle-props=_$
(mangle all properties ending in _
).
Sometimes it's desirable to also minify strings containing property names, even though it's not possible to automatically determine which strings are property names. This release makes it possible to do this by annotating those strings with /* @__KEY__ */
. This is a convention that Terser added earlier this year, and which esbuild is now following too: https://github.com/terser/terser/pull/1365. Using it looks like this:
// Original code
console.log(
[obj.mangle_, obj.keep],
[obj.get('mangle_'), obj.get('keep')],
[obj.get(/* @__KEY__ */ 'mangle_'), obj.get(/* @__KEY__ */ 'keep')],
)
// Old output (with --mangle-props=_$)
console.log(
[obj.a, obj.keep],
[obj.get("mangle_"), obj.get("keep")],
[obj.get(/* @__KEY__ */ "mangle_"), obj.get(/* @__KEY__ */ "keep")]
);
// New output (with --mangle-props=_$)
console.log(
[obj.a, obj.keep],
[obj.get("mangle_"), obj.get("keep")],
[obj.get(/* @__KEY__ */ "a"), obj.get(/* @__KEY__ */ "keep")]
);
Support /* @__NO_SIDE_EFFECTS__ */
comments for functions (#3149)
Rollup has recently added support for /* @__NO_SIDE_EFFECTS__ */
annotations before functions to indicate that calls to these functions can be removed if the result is unused (i.e. the calls can be assumed to have no side effects). This release adds basic support for these to esbuild as well, which means esbuild will now parse these comments in input files and preserve them in output files. This should help people that use esbuild in combination with Rollup.
Note that this doesn't necessarily mean esbuild will treat these calls as having no side effects, as esbuild's parallel architecture currently isn't set up to enable this type of cross-file tree-shaking information (tree-shaking decisions regarding a function call are currently local to the file they appear in). If you want esbuild to consider a function call to have no side effects, make sure you continue to annotate the function call with /* @__PURE__ */
(which is the previously-established convention for communicating this).
Readme
This is the cross-platform WebAssembly binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the JavaScript API documentation for details.
FAQs
The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.
We found that esbuild-wasm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).