Do not transcode images if they meet the size thresholds

This commit is contained in:
Josh Perez 2021-08-23 17:24:52 -04:00 committed by GitHub
parent 9066067aa4
commit 81c57107ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 89 additions and 10 deletions

View file

@ -1,6 +1,8 @@
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const webpack = require('webpack');
module.exports = ({ config }) => {
config.entry.unshift(
'!!style-loader!css-loader!sanitize.css',
@ -29,5 +31,11 @@ module.exports = ({ config }) => {
net: 'net',
};
config.plugins.unshift(
new webpack.IgnorePlugin({
resourceRegExp: /sharp$/,
})
);
return config;
};