gulp-community / gulp-cached

A simple in-memory file cache for gulp
MIT License
452 stars 23 forks source link

cache destination name #20

Open tobsn opened 8 years ago

tobsn commented 8 years ago
gulp.task('indexfiles', function() {
    return gulp.src('./**/index.src.php')
        .pipe(inlinesource())
        .pipe(usemin({
            inlinecss: [ minifyCss, 'concat' ],
            inlinejs: [uglify(), 'concat']
        }))
        .pipe(cache('index'))
        .pipe(gulpif(
            (process.env.ENV !== 'development'),
            replace('"/assets/', '"https://cdn/assets/')
        ))
        .pipe(rename({
            basename: 'index'
        }))
        .pipe(gulp.dest('.'));
});

Is there any way of telling the module that the outcome will be "index.php" because of the rename? My source files are in the same directory as the output - source is index.src.php and output is index.php

Thanks!

yocontra commented 7 years ago

Not sure I understand the issue, could you elaborate or provide a smaller more focused code sample? The cache should be placed before any transformations so they only get executed when the file changes.