Skip to content

DrSensor/binaryen-loader

Repository files navigation

npm node deps tests chat size

binaryen-loader

loader to reduce wasm code size based on Binaryen

Requirements

This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.

Getting Started

To begin, you'll need to install binaryen-loader:

$ npm install binaryen-loader --save-dev

Then add the loader to your webpack config. For example:

Then add the plugin to your webpack config. For example:

file.ext

import file from 'file.ext';

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /.ext$/,
        use: [
          {
            loader: `binaryen-loader`,
            options: {...options}
          }
        ]
      }
    ]
  }
}

webpack.config.js

module.exports = {
  plugins: [
    new `Binaryen`Plugin(options)
  ]
}

And run webpack via your preferred method.

Options

[option]

Type: [type|other-type] Default: [type|null]

[ option description ]

// in your webpack.config.js
{
  loader: `binaryen-loader`,
  options: {
    [option]: ''
  }
}
// in your webpack.config.js
new `Binaryen`Plugin({
  [option]: ''
})

Examples

[ example outline text ]

webpack.config.js

// Example setup here..

file.ext

// Source code here...

bundle.js

// Bundle code here...

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

License

About

webpack loader for Binaryen

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •