Skip to content

Commit

Permalink
clean up based on suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcsapo committed May 26, 2020
1 parent 8a0f41c commit ff1184f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class SassCompiler extends Filter {
this.inputTree = inputTree;
this.inputOutputMap = inputOutputMap;
this.lastBuildStart = undefined;
this.extensions = ['scss', 'sass'];
this.targetExtension = 'css';

this.renderSassSync = options.implementation.renderSync;

Expand Down Expand Up @@ -94,7 +96,7 @@ class SassCompiler extends Filter {
*/
rethrowBuildError(error) {
if (typeof error === 'string') {
throw new Error('[string exception] ' + error);
throw new Error('ember-cli-sass: [string exception] ' + error);
} else {
error.type = 'Sass Syntax Error';
error.message = error.formatted;
Expand All @@ -108,9 +110,6 @@ class SassCompiler extends Filter {
}
}

SassCompiler.prototype.extensions = ['scss', 'sass'];
SassCompiler.prototype.targetExtension = 'css';

function SASSPlugin(optionsFn) {
this.name = 'ember-cli-sass';
this.optionsFn = optionsFn;
Expand Down Expand Up @@ -160,17 +159,18 @@ SASSPlugin.prototype.toTree = function(tree, inputPath, outputPath, inputOptions
return { input, output };
});

var trees = [
new SassCompiler(new Funnel(mergeTrees(inputTrees), {
include: ['**/*.scss', '**/*.sass', '**/*.css'],
}), inputOutputMap, options)
];
const compileSassTree = new SassCompiler(new Funnel(mergeTrees(inputTrees), {
include: ['**/*.scss', '**/*.sass', '**/*.css'],
}), inputOutputMap, options);

if (options.passthrough) {
inputTrees.push(new Funnel(tree, options.passthrough));
return mergeTrees([
new Funnel(tree, options.passthrough),
compileSassTree,
], { overwrite: true })
}

return mergeTrees(trees, { overwrite: true });
return compileSassTree;
};

module.exports = {
Expand Down

0 comments on commit ff1184f

Please sign in to comment.