CSS minify and rename with gulp

后端 未结 3 1062
走了就别回头了
走了就别回头了 2021-02-01 15:59

I\'ve a variable like

var files = {
    \'foo.css\': \'foo.min.css\',
    \'bar.css\': \'bar.min.css\',
};

What I want the gulp to do for me is

3条回答
  •  既然无缘
    2021-02-01 16:56

    This is what I have done

    var injectOptions = {
         addSuffix: '?v=' + new Date().getTime()
    };
    

    Then

    return gulp.src('*.html')
        .pipe(wiredep(options))
        .pipe(inject(injectSrc, injectOptions))
        .pipe(gulp.dest(''));
    

    end result is unique timestamp added

    Example in index.html

       
    

提交回复
热议问题