Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用gulp usemin软件包字体_Javascript_Css_Gulp - Fatal编程技术网

Javascript 如何使用gulp usemin软件包字体

Javascript 如何使用gulp usemin软件包字体,javascript,css,gulp,Javascript,Css,Gulp,我目前正在使用pluign,但是我有一件事要做:使用软件包提供的图像 <!-- build:css lib/css/main.min.css --> <link rel="stylesheet" type="text/css" href="bower_components/font-awesome/css/font-awesome.css"> <!-- endbuild --> 现在,它用上面的构建路径扫描我的HTML,并成功地缩小它 然而,我的

我目前正在使用pluign,但是我有一件事要做:使用软件包提供的图像

  <!-- build:css lib/css/main.min.css -->
  <link rel="stylesheet" type="text/css" href="bower_components/font-awesome/css/font-awesome.css">
  <!-- endbuild -->
现在,它用上面的构建路径扫描我的HTML,并成功地缩小它

然而,我的问题是,现在我的字体可怕的CSS正在错误的地方寻找字体,因为它们不再在同一个目录中


如何解决此问题?

通过找到以下问题解决了此问题:

我的任务现在是使用gulp重命名:


查找../fonts/的软件包中的字体现在指向了正确的位置。

gulp流的.dest在哪里?编辑了我的问题以显示整个任务!我相信您可以摆脱重命名管道,将gulp.src更改为gulp.srcpaths.bower_字体,{base:path.bower_字体}。
gulp.task('usemin', function() {
    return gulp.src('src/index.html')
        .pipe(usemin({
            css: [minifyCss(), 'concat'],
        }))
        .pipe(gulp.dest('dist/'));
});
gulp.task('copy-bower_fonts', function() {
    return gulp.src(paths.bower_fonts)
        .pipe(rename({
            dirname: '/fonts'
        }))
        .pipe(gulp.dest('dist/lib'));
});