Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for mergeTrees configuration, fixes #32 #33

Merged
merged 2 commits into from
Oct 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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