gulp-rev: Merge is broken on 3.0.0
I just updated the appendExisting
(https://github.com/sindresorhus/gulp-rev/issues/65#issuecomment-68610591) option to merge
(https://github.com/sindresorhus/gulp-rev/releases/tag/v3.0.0) and now the manifest file is not being updated š¦
My gulpfile.js
var publicPath = 'public/'
gulp.task('js', function() {
return gulp.src(scriptsPath + 'main.js', { base: path.join(process.cwd(), 'public/app') } )
.pipe(browserify({
insertGlobals: true,
debug: true
}))
// Bundle to a single file
.pipe(concat('scripts/app.js'))
.pipe(uglify())
.pipe(rev())
.pipe(gulp.dest(publicPath))
.pipe(rev.manifest({
base: publicPath,
merge: true
}))
.pipe(gulp.dest(publicPath))
});
The existing rev-manifest.json file is
{
"styles/main.css": "styles/main-23ea264f.min.css"
}
The app.js is correctly minified and revād but the manifest file is not updated.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 17 (3 by maintainers)
Iāve been playing with this for a while, and it looks like āthe right oneā (last example from #77) isnāt right. When you donāt set path to your manifest file, it uses default which is: ārev-manifest.jsonā. But what that means is:
What getās passed to vinyl is:
And when that ends up in:
ā¦it returns āā¦/rev-manifest.jsonā. So gulp.dest goes one directory back from ādistā and writes ārev-manifest.jsonā in cwd. So, if we want ārev-manifest.jsonā inside ādistā, āthe right oneā should look like this:
As an example, I made a setup like this:
So it resolved to: āā¦/ā¦/ā¦/rev-manifest.jsonā, which is: ā/home/rev-manifest.jsonā, which is error (access permissions).
If this is expected behavior, maybe the docs should emphasize this, something like gulp-util does with their ānew File(obj)ā. I think that people expect to see their ārev-manifest.jsonā in their gulp.dest location if they donāt mess with the options.
I have also been struggling with this.
This is rather mind boggling and totally not intuitive. But it does work.
It works doing this trick
Has @bobthecow said here https://github.com/sindresorhus/gulp-rev/pull/77#issuecomment-68076646
@nfantone thanks I just managed to get it work following your hack⦠pheeeew š