Search code examples
lessember-clibroccolijs

How to pass param {overwrite: true} in Brocfile.js


info:

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

I have the next error:

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.

I tried what say in this post and this other. But I still without results.

Thanks for your time


Solution

  • Since none of the methods mentioned in the previous links worked. I choose to modify the ember-cli-less package:

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

    I changed the line:

    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
    }