The package `gulp-build` (version 0.5.3) is a Gulp 3 plugin designed to process files by swapping in variables using Handlebars templates. It facilitates building files for different environments by dynamically injecting data like Google Analytics IDs or compiling static HTML. Key features include support for Handlebars helpers, partials, and layouts, which were introduced in version 0.5.0, replacing earlier Underscore template integration. The plugin's current version (0.5.3) dates back to 2014 based on the copyright notice in its README, suggesting a lack of recent development. Its release cadence is effectively halted. It differentiates itself by providing a simple Handlebars-based templating pipeline within a Gulp 3 workflow, though a noted limitation is that partials and layouts must be provided as raw strings rather than file globs. Given its age and the fact that Gulp itself has advanced significantly beyond version 3, this package is effectively abandoned and may not be compatible with modern Gulp setups.
npm install gulp-buildVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of `gulp-build` to process HTML files using Handlebars with dynamic data, partials, and a layout.
Rewrite all existing Underscore templates to Handlebars syntax. Consult Handlebars documentation for syntax and helper migration.
Ensure your `config.layout` string explicitly includes `{{> body}}` where you want the main content to be inserted.Manually read partial and layout files into strings before passing them to the `gulp-build` options. For example, use `fs.readFileSync` to load templates.
Evaluate alternative, actively maintained templating plugins for Gulp or migrate to a different build system if Gulp 3 compatibility is not critical.
Edit your `config.layout` string to include `{{> body}}` at the position where the main file content should be rendered.Rewrite your templates from Underscore.js syntax to Handlebars syntax. Ensure all helpers, partials, and data references conform to Handlebars specifications.