Grunt多任务在构建时抛出EISDIR错误 [英] Grunt multi-tasks throwing EISDIR error when building

查看:168
本文介绍了Grunt多任务在构建时抛出EISDIR错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置grunt来缩小src目录中的许多js文件,并将它们复制到构建目录中。遵循 grunt任务文档,我相信下面的配置应该可以工作。

  uglify:{
dist:{
files:[
{
expand: true,//启用动态扩展。
cwd:'src / js /',// Src匹配相对于此路径。
src:['** / ?. js'],//实际匹配的模式。
dest:'build / minified /',//目标路径前缀。
ext:'.min.js'// Dest文件路径将具有此扩展名。
}
]
}
}

我运行grunt我收到消息

lockquote
运行uglify:dist(uglify)任务
警告:无法写入build /缩小文件(错误代码:EISDIR)。使用--force继续。

如果我将定义切换为使用手动文件路径,它可以正常工作。文档不正确?或者我使用它错了?



我正在运行grunt v0.4.0rc2

解决方案

div>

更新grunt并用 src:['** / *。]替换 src:['** / ?. js'] js']



欲了解更多信息,请参阅 globbing patterns


I am trying to set up grunt to minify a number of js files in a src directory and copy them to a build directory. Following the grunt task documentation, I believe the below configuration should work.

uglify: {
    dist: {
      files: [
        {
          expand: true,     // Enable dynamic expansion.
          cwd: 'src/js/',   // Src matches are relative to this path.
          src: ['**/?.js'], // Actual pattern(s) to match.
          dest: 'build/minified/',   // Destination path prefix.
          ext: '.min.js'    // Dest filepaths will have this extension.
        }
      ]
    }
  }

When I run grunt I get the message

Running "uglify:dist" (uglify) task Warning: Unable to write "build/minified" file (Error code: EISDIR). Use --force to continue.

If I switch the definition to use manual file paths it works fine. Is the documentation incorrect? or am I using it wrong?

I am running grunt v0.4.0rc2

解决方案

Update grunt and replace src: ['**/?.js'] with src: ['**/*.js']

For more information see the guide on globbing patterns.

这篇关于Grunt多任务在构建时抛出EISDIR错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆