0.1.1 • Published 6 years ago

binaryen-webpack-plugin v0.1.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
6 years ago

Binaryen Webpack Plugin

A plugin for webpack that runs Binaryen on WebAssembly assets, shrinking and optimizing them. You can think of Binaryen as a minifier for WebAssembly the same way that there are minifiers for JavaScript.

Install

npm i -D binaryen-webpack-plugin

Usage

var BinaryenPlugin = require("binaryen-webpack-plugin");
module.exports = {
  plugins: [
    new BinaryenPlugin({})
  ]
}

TODO

  • Arguments (pick the optimization level, passes to run, files to filter, etc.) and docs for them.
  • Code cleanup (I'm new to npm and webpack).
  • This currently runs the Binaryen optimizer on each wasm asset. We can do even better by running Binaryen metadce on the entire graph, so that if JS (and other wasm modules) don't use something a wasm file then we can remove it. This would need deeper integration with webpack.