Answer the question
In order to leave comments, you need to log in
Why is the gulp-changed plugin not working?
The project structure is as follows:
dist
- css
- js
- vendor
src
- components
- index
- template
- include_file_1.html
- include_file_2.html
- index.html
- alerts
- team
- ...
- js
- scss
var gulp = require('gulp'),
changed = require('gulp-changed'),
fileInclude = require('gulp-file-include');
gulp.task('html', function () {
gulp.src('src/components/**/index.html')
.pipe(changed('dist', {hasChanged: changed.compareSha1Digest}))
.pipe(fileInclude())
.pipe(gulp.dest('dist'))
});
Answer the question
In order to leave comments, you need to log in
Use gulp-changed
for binary files
and gulp-changed-in-place
for text
files
Well, the plugin needs to be inserted after assembly. You check the hash of a file that has not yet been processed (without includes), of course it will differ from the processed one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question