Socket
Socket
Sign inDemoInstall

esbuild-wasm

Package Overview
Dependencies
0
Maintainers
1
Versions
458
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    esbuild-wasm

The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.


Version published
Maintainers
1
Install size
10.7 MB
Created

Changelog

Source

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

Source

esbuild

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

Last updated on 12 Jun 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc