Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-plugin-wasm-pack

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-wasm-pack

An esbuild plugin that runs wasm-pack.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
decreased by-80.52%
Maintainers
1
Weekly downloads
 
Created
Source

esbuild-plugin-wasm-pack

An esbuild plugin that runs wasm-pack before each build.

Requirements

  • node >=0.10.0
  • esbuild >= 0.11.15
  • rust/cargo
  • wasm-pack

*Make sure you have wasm-pack installed and in your PATH.*

Installation

npm install --save-dev esbuild-plugin-wasm-pack

or

yarn add --dev esbuild-plugin-wasm-pack

Usage

Simply add it to your esbuild plugins list

// build.ts
import esbuild from 'esbuild';
import wasmpack from 'esbuild-plugin-wasm-pack';

esbuild.build({
    ...
    plugins: [
        wasmpack({
            // options (see below)
        })
    ]
    ...
});

Configuration

The configuration options match the arguments to wasm-pack build.

OptionTypeDefault ValueDescription
logLevelstring"info"The maximum level of messages that should be logged by wasm-pack.
Possible values: info, warn, error
profilestring"dev"Sets the build profile
Options:
  • dev - Create a development build. Enables debug info and disables optimizations.
  • profiling - Create a profiling build. Enables optimizations and debug info.
  • release - Create a release build. Enables optimizations and disables debug info.
noTypescriptbooleanfalseBy default a *.d.ts file is generated for the generated JS file. This flag will disable generating this TypeScript file.
modestring"normal"Sets steps to be run.
Possible values: no-install, normal, force
outDirstring"pkg"Sets the output directory with a relative path.
outNamestring<package name>Sets the output file names. Defaults to package name.
scopestring-The npm scope to use in package.json, if any.
targetstring"bundler"Sets the target environment.
Possible values: bundler, nodejs, web, no-modules
pathstring-The path to the Rust crate. If not set, searches up the path from the current directory.
extraOptionsstring[][]A list of extra options to pass to cargo build.
extraPackOptionsstring[][]A list of extra options to pass to wasm-pack
wasmPackPathstring-Overrides the path to the wasm-pack executable. This can also be set via the WASM_PACK_PATH environment variable.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Keywords

FAQs

Package last updated on 12 Jan 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc