Skip to content

kripken/binaryen-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Binaryen plugin for webpack: shrinks wasm files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published