Build 添加uri.js bower组件会破坏我的Grunfile.js,它会认为uri.js目录是一个文件。如何修复?

Build 添加uri.js bower组件会破坏我的Grunfile.js,它会认为uri.js目录是一个文件。如何修复?,build,gruntjs,uri,bower,yo,Build,Gruntjs,Uri,Bower,Yo,Yeoman生成的Gruntfile.js在grunt构建过程中死亡,具体如下: Running "rev:dist" (rev) task dist/public/app/app.js >> b90d2f58.app.js dist/public/app/vendor.js >> 2deb5480.vendor.js Warning: Unable to read "dist/public/bower_components/uri.js" file (Error cod

Yeoman生成的Gruntfile.js在grunt构建过程中死亡,具体如下:

Running "rev:dist" (rev) task
dist/public/app/app.js >> b90d2f58.app.js
dist/public/app/vendor.js >> 2deb5480.vendor.js
Warning: Unable to read "dist/public/bower_components/uri.js" file (Error code: EISDIR). Used --force, continuing.
显然,它将uri.js组件目录解释为一个文件!一个简单的修复方法是将uri.js组件重命名为uri_js或类似的东西。但是,除了这样做,是否有一个简单的开关可以添加到进行哈希处理的实用程序中,从而知道“uri.js”不是一个文件???我已经尝试将“filter:'isFile'”添加到Grunfile中以*.js作为模式的每个位置,但没有效果


任何已经看到这一点的人,都非常感谢你的帮助。现在我只是在做咕噜建造——原力。谢谢

我终于发现可以从重命名过程中排除此bower_组件。关键是rev工件中文件的顺序取决于选择的顺序。所以我修改了Grunfile.js的这一部分。。。一切都很好

// Renames files for browser caching purposes
rev: {
  dist: {
    files: {
      src: [
        '<%= yeoman.dist %>/public/{,*/}*.js',
        '<%= yeoman.dist %>/public/{,*/}*.css',
        '<%= yeoman.dist %>/public/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
        '<%= yeoman.dist %>/public/assets/fonts/*',
        '!<%= yeoman.dist %>/public/bower_components/uri.js'
      ]
    }
  }
//重命名文件以用于浏览器缓存
修订版:{
地区:{
档案:{
src:[
“/public/{,*/}*.js”,
“/public/{,*/}*.css”,
“/public/assets/images/{,*/}{png,jpg,jpeg,gif,webp,svg}”,
“/public/assets/font/*”,
“!/public/bower_components/uri.js”
]
}
}
关键的补充是最后一块:

        '!<%= yeoman.dist %>/public/bower_components/uri.js'
“!/public/bower\u components/uri.js”
我希望这能帮助其他人解决这个问题