refactor(lqip-loader): split test files (#6858)

This commit is contained in:
Joshua Chen 2022-03-06 18:34:04 +08:00 committed by GitHub
parent f763ac13a9
commit 5e2168ea22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 25 deletions

View file

@ -25,6 +25,8 @@ export default async function lqipLoader(
const config = this.getOptions() || {};
config.base64 = 'base64' in config ? config.base64 : true;
// color palette generation is set to false by default
// since it is little bit slower than base64 generation
config.palette = 'palette' in config ? config.palette : false;
let content = contentBuffer.toString('utf8');
@ -53,8 +55,6 @@ export default async function lqipLoader(
const outputPromises: [Promise<string> | null, Promise<string[]> | null] = [
config.base64 === true ? lqip.base64(imgPath) : null,
// color palette generation is set to false by default
// since it is little bit slower than base64 generation
config.palette === true ? lqip.palette(imgPath) : null,
];