如何在Brocfile.js中传递param {overwrite:true}

时间:2015-05-19 01:54:01

标签: less ember-cli broccolijs

信息:

ember-cli: 0.2.5,
ember-cli-less: 1.3.3,

我有下一个错误:

Merge error: file assets/mobile.css.map exists in mobile/tmp/caching-writer-dest-dir_ZcaW3C.tmp and /mobile/tmp/caching-writer-dest-dir_E4iROO.tmp
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.

我在this帖子和other中试了一下。但我仍然没有结果。

感谢您的时间

4 个答案:

答案 0 :(得分:1)

由于前面链接中提到的方法都不起作用。我选择修改ember-cli-less包:

node_modules/ember-cli-less/node_modules/broccoli-merge-trees/index.js

我换了一行:

function TreeMerger (inputTrees, options) {
  if (!(this instanceof TreeMerger)) return new TreeMerger(inputTrees, options)
  if (!Array.isArray(inputTrees)) {
    throw new Error('Expected array, got ' + inputTrees)
  }
  this.inputTrees = inputTrees
  this.options = { overwrite: true } // <- This line
}

答案 1 :(得分:1)

如果您使用的是mac,可以试试find . -name '.DS_Store' -type f -delete吗?

我有类似的问题,我可以通过删除重复文件来解决。

错误消息

Build failed.
Merge error: file .DS_Store exists in /Users/ember-proj/tmp/broccoli_merge_trees-input_base_path-qaWJUMIJ.tmp/0 and /Users/ember-proj/ai/tmp/broccoli_merge_trees-input_base_path-qaWJUMIJ.tmp/1
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.

答案 2 :(得分:0)

mergeTrees模块有overwrite选项。

此处记录:https://github.com/broccolijs/broccoli-merge-trees#options

以下是一个例子:

return new MergeTrees([app.toTree(), fonts], { overwrite: true });

答案 3 :(得分:0)

将ember-cli-less更新到最新版本(现为1.5.3),然后像这样传递配置。

'ember-cli-less': {
  mergeTrees: {
    overwrite: true
  }
}
事情会起作用