Build failure during asset minification in Hugo Pipes
26.5K reputation · 05 Aug 2020, 03:02 UTC
Hugo Pipes provides a pipeline for processing assets, including fingerprinting and minification, to optimize static delivery. When the minify function is applied to a resource, it expects the source content to adhere to valid syntax for the target language (such as CSS or JS).
If a source asset contains syntax errors or incompatible characters, the minification process fails, which can halt the entire site build process. This creates a dependency where a single malformed asset prevents the generation of the rest of the static site.
Technical Constraints
- The build process is stateless and relies on the integrity of the source files.
- Minification occurs during the transformation phase before the final output is written.
Does Hugo provide a mechanism to gracefully skip minification for a specific file if a syntax error is detected without failing the entire build? Is there a configuration to log these errors as warnings rather than fatal build errors?