mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-13 09:13:59 +02:00
chore (shader-minifier-loader): add a feature to bypass minifier
This commit is contained in:
@@ -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 ) => {
|
||||
|
Reference in New Issue
Block a user