0.1.0 • Published 4 years ago
image-bunker v0.1.0
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",
});
]
0.1.0
4 years ago