Skip to content

Commit

Permalink
Merge pull request #33 from knownasilya/merge-trees-options
Browse files Browse the repository at this point in the history
Add option for mergeTrees configuration, fixes #32
  • Loading branch information
Ilya Radchenko committed Oct 13, 2015
2 parents a77eaec + 4a8a362 commit 0b1af99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ var app = new EmberApp({
- `paths`: an array of include paths
- `sourceMap`: whether to generate source maps. Defaults to `true` in development. sourceMap can also
take an object of sub options: http://lesscss.org/usage/#programmatic-usage
- `mergeTrees`: an object of the available options to pass to the internal [merge trees] plugin

## Configuring Input/Output Paths

You can configure the input and output files using ember-cli's `outputPaths` option in `ember-cli-build.js`:

```javascript
var app = new EmberApp({
outputPaths: {
Expand All @@ -50,10 +52,17 @@ var app = new EmberApp({
'theme-purple': '/assets/theme-purple.css'
}
}
},
lessOptions: {
mergeTrees: {
overwrite: true
}
}
});
```

Notice that the `mergeTrees.overwrite` option is currently required for this to work.

## Usage in Addons

You can also use this to precompile less files in an addon. By default, this
Expand Down Expand Up @@ -105,3 +114,5 @@ your local filesystem in Chrome:
- Code inspired by: [ember-cli-sass](https://github.com/aexmachina/ember-cli-sass). Credits to the author.
- [broccoli-less-single](https://github.com/gabrielgrant/broccoli-less-single)
- [less](https://github.com/less/less.js)

[merge trees]: https://github.com/broccolijs/broccoli-merge-trees#options
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LESSPlugin.prototype.toTree = function(tree, inputPath, outputPath, inputOptions
return new LESSCompiler([tree], input, output, options);
});

return mergeTrees(trees);
return mergeTrees(trees, options.mergeTrees);
};

module.exports = {
Expand Down

0 comments on commit 0b1af99

Please sign in to comment.