Skip to content

Commit

Permalink
Remove sass-graph because node-sass v2 includes list of included files
Browse files Browse the repository at this point in the history
  • Loading branch information
jstcki committed Jan 14, 2015
1 parent 752e672 commit 14c5524
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
20 changes: 3 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var utils = require('loader-utils');
var sass = require('node-sass');
var path = require('path');
var sassGraph = require('sass-graph');

module.exports = function (content) {
this.cacheable();
Expand All @@ -25,28 +24,15 @@ module.exports = function (content) {

// output compressed by default
opt.outputStyle = opt.outputStyle || 'compressed';

var loadPaths = opt.includePaths;
var markDependencies = function () {
try {
var graph = sassGraph.parseFile(this.resourcePath, {loadPaths: loadPaths});
graph.visitDescendents(this.resourcePath, function (imp) {
this.addDependency(imp);
}.bind(this));
} catch (err) {
this.emitError(err);
}
}.bind(this);

opt.success = function (result) {
markDependencies();
result.stats.includedFiles.forEach(this.addDependency);
callback(null, result.css, result.map);
}.bind(this);

opt.error = function (err) {
markDependencies();
callback(err);
}.bind(this);
callback({message: err.message + ' (' + err.line + ':' + err.column + ')'});
};

sass.render(opt);
};
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"license": "MIT",
"dependencies": {
"loader-utils": "^0.2.5",
"node-sass": "^2.0.0-beta",
"sass-graph": "git+https://github.com/lox/sass-graph.git#3a17328"
"node-sass": "^2.0.0-beta"
},
"devDependencies": {
"mocha": "^2.0.1",
Expand Down

0 comments on commit 14c5524

Please sign in to comment.