mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-14 01:33:58 +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 ) {
|
module.exports = async function( content ) {
|
||||||
const callback = this.async();
|
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 options = getOptions( this );
|
||||||
|
|
||||||
const minifierOptions = buildMinifierOptionsString( options );
|
const minifierOptions = buildMinifierOptionsString( options );
|
||||||
|
|
||||||
const name = path.basename( this.resourcePath );
|
|
||||||
|
|
||||||
const contentSanitized = sanitizeContent( content );
|
const contentSanitized = sanitizeContent( content );
|
||||||
|
|
||||||
const minified = await tempy.file.task( async ( pathOriginal ) => {
|
const minified = await tempy.file.task( async ( pathOriginal ) => {
|
||||||
|
Reference in New Issue
Block a user