Josiah / gulp-cachebust

Generates checksums and renames references to files, useful for cachebusting
30 stars 10 forks source link

Call hash.end() after piping file through it #6

Closed vast closed 9 years ago

vast commented 9 years ago

Fixes the following error when using browserify:

node_modules/gulp-cachebust/index.js:34
    return hash.read().toString('hex').substr(0, this.checksumLength);
                       ^
TypeError: Cannot call method 'toString' of null
  at CacheBuster.getChecksum (/Users/vast/src/beta.shkshk.ru/node_modules/gulp-cachebust/index.js:34:24)
  at CacheBuster.getBustedPath (/Users/vast/src/beta.shkshk.ru/node_modules/gulp-cachebust/index.js:38:25)

gulp task:

bundler = browserify(entries: ["./" + app_config.paths.main_javascript], extenstions: [".coffee"])

gulp.task "javascripts", ["clean:javascripts"], ->
  bundler.bundle()
    .pipe(source("application.js"))
    .pipe(cachebuster.resources())
    .pipe(gulp.dest(app_config.buildpaths.assets))
Josiah commented 9 years ago

Published to npm as v0.0.5