0

Node plugin (Gulp v.4) normally overwrites files, but in this case, he will not overwrite file in the destination folder, why?

function rew_front() {
    return gulp.src( [ assets_front + '*.html'] )
        .pipe(version({
            'value' : '%DT%',
            'append' : {
                'key' : 'v',
                'cover' : 0,
                'to' : [
                    'css',
                    'js'
                ]
            }
        }))
        .pipe(rename({
            extname: '.latte',
        }))
        .pipe(cleanDest( app_front, {extension: '.latte'}))
        .pipe(gulp.dest( app_front ))
}

Even when I add new plugin for clearing destination folder, which it should first delete all files in the destination folder, then that function rew_front should create new files, but it not works.

If I will delete these files in destination folder by myself, and then I run rew_front function, it will create correctly new files, but only this way.

Why it's not working? Is there a problem with PhpStorm, some kind of settings?

Update:

I found that problem is in pipe and plugin gulp-version-number, where is applied version plugin, that plugin change every .html only, if MD5 is changed, but I need apply rewrite version everytime, even if .html is not change at all, just simply still changing version in links whenever I run that function

version         = require( 'gulp-version-number' ),
.pipe(version({
                'value' : '%DT%',
                'append' : {
                    'key' : 'v',
                    'cover' : 0,
                    'to' : [
                        'css',
                        'js'
                    ]
                }
            }))
Edoras
  • 319
  • 2
  • 4
  • 14
  • 1
    it's unlikely a PhpStorm issue, it's not PhpStorm that executes your function. Does your gulp task work when you run it in terminal? – lena Jun 11 '19 at 12:03
  • see also https://stackoverflow.com/questions/42959037/gulp-is-not-overwriting-the-destination-file – lena Jun 11 '19 at 12:04
  • 1
    @lena yes, I found that problem is in .pipe(version... where that plugin version only change file if source file is changed, but source file will be still same, so I need something to approve change file and apply on it function .pipe(version... every time even if that file will never change – Edoras Jun 11 '19 at 12:10
  • @lena that problem is not mine, its something else – Edoras Jun 11 '19 at 12:11

0 Answers0