Skip to content

Commit

Permalink
only rebuild on changes to (sass|scss|css) files (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitpaulk authored Apr 25, 2022
1 parent d67e675 commit 4d2c796
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@ function SASSPlugin(optionsFn) {

SASSPlugin.prototype.toTree = function(tree, inputPath, outputPath, inputOptions) {
var options = Object.assign({}, this.optionsFn(), inputOptions);
var inputTrees;

if (options.onlyIncluded) {
inputTrees = [new Funnel(tree, {
include: ['app/styles/**/*'],
var inputTrees = [
new Funnel(tree, {
include: [options.onlyIncluded ? 'app/styles/**/*' : /\.(scss|sass|css)$/],
annotation: 'Funnel (styles)'
})];
}
else {
inputTrees = [tree];
}
})
];

if (options.includePaths) {
inputTrees = inputTrees.concat(options.includePaths);
Expand Down

0 comments on commit 4d2c796

Please sign in to comment.