【问题标题】:Grunt Copy is not copying filesGrunt Copy 不复制文件
【发布时间】:2014-06-13 00:21:34
【问题描述】:

我正在尝试将一些字体复制到名为“fonts”的目录中。为此,我正在尝试使用 grunt-contrib-copy 任务。我的任务是这样设置的:

fonts: {
  cwd: 'src/vendor/library/release/fonts',
  expand: false,
  src: [ '*' ],
  dest: 'build/temp/fonts/'
},

当它通过 grunt 执行时,详细输出显示:

Running "copy:fonts" (copy) task
Verifying property copy.fonts exists in config...OK
Files: myfont.eot, myfont.svg, myfont.ttf, myfont.woff -> build/temp/fonts/
Options: processContent=false, processContentExclude=[]
Options: processContent=false, processContentExclude=[]
Copying myfont.eot -> build/temp/fonts/myfont.eot
Reading myfont.eot...ERROR
Warning: Unable to read "myfont.eot" file (Error code: ENOENT). Use --force to continue.

我做错了什么?为什么我的字体文件没有被复制?

谢谢!

【问题讨论】:

  • 我假设您在 Windows 上运行它?如果是这样我也有这个问题。在 Mac osx 上它运行良好,这让我相信这是一个 Windows 问题。

标签: gruntjs


【解决方案1】:

您必须将expand 设置为true,这对我有用。 事实上,我是从你那里得到这个想法的。

参考:grunt-contrib-copy reference

【讨论】:

    【解决方案2】:

    我遇到了这个问题。我发现我使用的是“grunt-copy”而不是“grunt-contrib-copy”。我用npm uninstall grunt-copy 卸载了 grunt-copy 并运行了npm --save-dev grunt-contrib-copy,一切都按预期工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-25
      • 1970-01-01
      • 1970-01-01
      • 2018-02-13
      • 2015-07-05
      • 2013-08-17
      • 1970-01-01
      • 2017-12-21
      相关资源
      最近更新 更多