shonny-ua / gulp-rev-collector

Static asset revision data collector from manifests, with was generated from different streams and replace they's links in html template.
MIT License
150 stars 41 forks source link

@font-face not work #42

Open kang-lyk opened 6 years ago

kang-lyk commented 6 years ago

I user ‘gulp-filter ’

gulp.task('css', function() {   
    let plugins = [
            autoprefixer(postcssConfig.autoprefixer)
        ],
        filterCss = filter('**/*.css', {restore: true});

    gulp
        .src([     
            'rev/{css,images}/*.json',       
            'src/**/*.css',
            '!src/**/_*.css'
        ])
        .pipe(filterCss)
        .pipe(postcss(plugins))        
        .pipe(sourcemaps.init({loadMaps: true})) 
        .pipe(rev()) 
        .pipe(sourcemaps.write('./'))
        .pipe(filterCss.restore)
        .pipe(revCollector({
            replaceReved: true
        }))
        .pipe(gulp.dest('dist'))
        .pipe(rev.manifest())
        .pipe(gulp.dest('rev/css'));
});

Images is OK,

.logo {
    width: 388px;
    height: 120px;
    background: #fff url(images/logo.png) 0 0 no-repeat;
}
////﹀﹀﹀﹀﹀﹀
.logo {
    width: 388px;
    height: 120px;
    background: #fff url(images/logo-4761c15022.png) 0 0 no-repeat;
}

But @font-face not work

@font-face {font-family: "iconfont";
    src: url('fonts/iconfont.eot?t=1505980166163'); /* IE9*/
    src: url('fonts/iconfont.eot?t=1505980166163#iefix') format('embedded-opentype'), /* IE6-IE8 */
    url('fonts/iconfont.ttf?t=1505980166163') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
    url('fonts/iconfont.svg?t=1505980166163#iconfont') format('svg'); /* iOS 4.1- */
}
shonny-ua commented 6 years ago

Your file suffix for fonts placed in query part of link? Not in filename suffix? Can You write Your work manifest file content?