i’m actually wondering the same… if there is a possibility to skip pipes execution based on a condition?
Like @regis mentioned in Hugo Pipes Revolution | Regis Philibert
When running
hugo serveryou may test .Site.IsServer before adding fingerprint, SRI and minify to your assets.
so it would be nice based on .Site.IsServer (or any other condition) to skip minifying and fingerprinting when in development mode.
i’m now doing this:
{{ $jqueryJs := resources.Get "assets/js/jquery/jquery.slim.js" }}
{{ $bootstrapJs := resources.Get "assets/js/bootstrap/bootstrap.bundle.js" }}
{{ if hugo.IsProduction }}
{{ $jqueryJs = resources.Get "assets/js/jquery/jquery.slim.min.js" | fingerprint }}
{{ $bootstrapJs = resources.Get "assets/js/bootstrap/bootstrap.bundle.min.js" | fingerprint }}
{{ end }}
<script src="{{ $jqueryJs.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $jqueryJs.Data.Integrity }}"{{ end }} crossorigin="anonymous"></script>
<script src="{{ $bootstrapJs.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $bootstrapJs.Data.Integrity }}"{{ end }} crossorigin="anonymous"></script>
but it is a bit cumbersome when doing this for multiple resources…