image-bunker
v0.1.0
Published
把[squoosh](https://github.com/GoogleChromeLabs/squoosh)的几个`wasm`编码模块拎出来做一个独立的包
Downloads
2
Readme
ImageBunker
把squoosh的几个wasm
编码模块拎出来做一个独立的包
import getCodec from "image-bunker";
const imagequant = await getCodec("imagequant");
const oxipng = await getCodec("oxipng");
const boweserpng = await getCodec("browserpng");
const mozjpeg = await getCodec("mozjpeg");
webpack.config
[
...
{
test: /\.wasm$/,
exclude: /_bg\.wasm$/,
type: "javascript/auto",
loader: "file-loader",
options: {
name: "[name].[hash:5].[ext]",
}
},
{
test: /_bg\.wasm$/,
type: "webassembly/experimental",
});
]