image-bunker
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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",
  });
]

Readme

Keywords

none

Package Sidebar

Install

npm i image-bunker

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

752 kB

Total Files

17

Last publish

Collaborators

  • y.t