Add feature detection to OxiPNG

This commit is contained in:
Ingvar Stepanyan
2020-09-24 13:29:32 +01:00
committed by Ingvar Stepanyan
parent 02c113a68f
commit bae243ccdb
8 changed files with 82 additions and 144 deletions

View File

@@ -149,7 +149,7 @@ module.exports = async function(_, env) {
{
// Emscripten modules don't work with Webpack's Wasm loader.
test: /\.wasm$/,
exclude: /(?<!\bsquoosh_oxipng)_bg\.wasm$/,
exclude: /(?<!\bpkg-parallel[\\/]squoosh_oxipng)_bg\.wasm$/,
// This is needed to make webpack NOT process wasm files.
// See https://github.com/webpack/webpack/issues/6725
type: 'javascript/auto',
@@ -160,7 +160,7 @@ module.exports = async function(_, env) {
},
{
// Wasm modules generated by Rust + wasm-pack work great with Webpack.
test: /(?<!\bsquoosh_oxipng)_bg\.wasm$/,
test: /(?<!\bpkg-parallel[\\/]squoosh_oxipng)_bg\.wasm$/,
type: 'webassembly/experimental',
},
{