Registry / devops / gulp-version-append

gulp-version-append

JSON →
library0.2.0jsnpmunverified

Gulp plugin that replaces @version@ placeholders in static file references with the version from package.json (or a custom JSON file) for cache-busting. Version 0.2.0 is the latest stable release. Unlike hash-based tools like gulp-rev-append, this plugin reads no file contents, making it faster for projects where all assets are bundled and change with every version bump. Supports multiple file extensions (html, js, css, etc.) and three append modes: version string, timestamp, or short GUID. The plugin is not actively maintained and relies on a deprecated template pattern (?v=@version@) rather than modern content-hashing or file-renaming approaches.

npm install gulp-version-append
INSTALL
IMPORT
SIG · GULP-VERSION-APPEN
G
gulp-version-append
devopsjavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import versionAppend from 'gulp-version-append'
const versionAppend = require('gulp-version-append');
ESM default import; CommonJS require also works but is legacy.
versionAppend
import { versionAppend } from 'gulp-version-append'
const { versionAppend } = require('gulp-version-append');
Named import not available; use default import only.
require syntax
import versionAppend from 'gulp-version-append'
const versionAppend = require('gulp-version-append').default;
The CommonJS module exports the function directly, not as a property.

Registers a Gulp task that replaces @version@ placeholders in HTML files with the version from package.json, then minifies the HTML.

import gulp from 'gulp'; import versionAppend from 'gulp-version-append'; import minifyHtml from 'gulp-minify-html'; gulp.task('html', function() { return gulp.src('src/*.html') .pipe(versionAppend(['html', 'js', 'css'])) .pipe(minifyHtml()) .pipe(gulp.dest('dist')); });
Debug
Known issues
gotchaOnly replaces patterns matching `.<extension>?v=@version@` exactly. Does not handle other cache-busting query parameters.
fix
Ensure your HTML templates use the exact placeholder format: e.g., <script src="/js/app.js?v=@version@"></script>
affects: *
deprecatedPlugin relies on gulp v3 style streams. Not compatible with gulp v4's async task resolution without wrapping.
fix
Use gulp v3 or wrap the task in a callback: gulp.task('html', (cb) => { ... cb(); })
affects: >=0.2.0
gotchaIf using CommonJS require, the export is the function itself, not an object with a 'default' property.
fix
Use `const versionAppend = require('gulp-version-append');` not `require('gulp-version-append').default`
affects: >=0.1.0
gotchaThe `versionFile` option path is relative to the project root (cwd), not the gulpfile.
fix
Place version.json at the root of your project or provide an absolute path.
affects: *
breakingNo breaking changes documented; the package is stable but unmaintained. Versions are unchanged since 0.2.0.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'gulp-version-append'
Missing installation or incorrect import path.
fix
Run `npm install gulp-version-append --save-dev` or ensure import is correct.
TypeError: versionAppend is not a function
CommonJS require incorrectly accessed .default property.
fix
Use `const versionAppend = require('gulp-version-append');` directly.
gulp: Did you forget to signal async completion?
Using gulp v4 without proper async handling.
fix
Wrap the task: `gulp.task('html', function(cb) { ... cb(); })` or return the stream.
ENOENT: no such file or directory, open 'package.json'
Missing package.json in project root.
fix
Create a package.json with a 'version' field or specify `versionFile` option.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
gulprequiredPeer dependency; the plugin is a Gulp plugin and requires Gulp to be installed.
Agent activity
10 hits · last 30 days
node
10
Resources
gulp-version-append — npm install gulp-version-append · libregistry