-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
cachebust.references() fails to match paths that starts with a folder name beginning with a period.
var gulp = require("gulp"),
concat = require("gulp-concat"),
inject = require("gulp-inject"),
uglify = require("gulp-uglify"),
CacheBuster = require("gulp-cachebust");
var cachebust = new CacheBuster();
gulp.task("min:js", function () {
return gulp.src([
"./app/*.js",
"./app/**/*.js"
])
.pipe(concat("./.build/js/bundled.min.js"))
.pipe(uglify())
.pipe(gulp.dest(".")) // writes out the original file for injection
.pipe(cachebust.resources())
.pipe(gulp.dest(".")); // writes the busted file
});
gulp.task("inject:index", function () {
return gulp.src('./templates/index.html' })
.pipe(inject(gulp.src('./.build/js/bundled.min.js', { read: false })))
.pipe(cachebust.references())
.pipe(gulp.dest('./.build/templates'));
});
After running tasks min:js followed by inject:js, the file written to /.build/templates/index.html contains the original file path instead of the expected busted file path. The busted file is generated.
Changing the /.build folder name to one that does not start with a period (ex: /build) works around the problem.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels