chore (shader-minifier-loader): add a feature to bypass minifier

This commit is contained in:
FMS-Cat
2021-03-14 03:57:12 +09:00
parent 5a1d96a898
commit 31d10138f1

View File

@@ -74,12 +74,21 @@ function sanitizeContent( content ) {
*/
module.exports = async function( content ) {
const callback = this.async();
const name = path.basename( this.resourcePath );
if ( content.includes( '#pragma shader_minifier_loader bypass' ) ) {
this.emitWarning( `#pragma shader_minifier_loader detected in ${ name }. Bypassing shader minifier` );
callback( null, content );
return;
}
const options = getOptions( this );
const minifierOptions = buildMinifierOptionsString( options );
const name = path.basename( this.resourcePath );
const contentSanitized = sanitizeContent( content );
const minified = await tempy.file.task( async ( pathOriginal ) => {