loader to reduce wasm code size based on Binaryen
This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.
To begin, you'll need to install binaryen-loader:
$ npm install binaryen-loader --save-devThen 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.
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]: ''
})[ example outline text ]
webpack.config.js
// Example setup here..file.ext
// Source code here...bundle.js
// Bundle code here...Please take a moment to read our contributing guidelines if you haven't yet done so.