sass-loader
Advanced tools
Comparing version 0.3.0 to 0.3.1
24
index.js
@@ -1,2 +0,1 @@ | ||
var util = require('util'); | ||
var utils = require('loader-utils'); | ||
@@ -7,3 +6,2 @@ var sass = require('node-sass'); | ||
module.exports = function (content) { | ||
@@ -17,3 +15,3 @@ this.cacheable(); | ||
// skip empty files, otherwise it will stop webpack, see issue #21 | ||
if(opt.data.trim() == '') { | ||
if (opt.data.trim() === '') { | ||
return callback(null, content); | ||
@@ -33,10 +31,17 @@ } | ||
opt.stats = {}; | ||
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); | ||
// mark dependencies | ||
var graph = sassGraph.parseFile(this.resourcePath, {loadPaths: opt.includePaths}); | ||
graph.visitDescendents(this.resourcePath, function (imp) { | ||
this.addDependency(imp); | ||
}.bind(this)); | ||
opt.success = function (css) { | ||
markDependencies(); | ||
callback(null, css); | ||
@@ -46,2 +51,3 @@ }.bind(this); | ||
opt.error = function (err) { | ||
markDependencies(); | ||
this.emitError(err); | ||
@@ -48,0 +54,0 @@ callback(err); |
{ | ||
"name": "sass-loader", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "SASS loader for Webpack", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "rm test/output/* && node ./node_modules/webpack/bin/webpack.js -d -w --config=test/webpack.config.js" | ||
"pretest": "node test/prepare.js", | ||
"test": "mocha -R spec" | ||
}, | ||
@@ -21,10 +22,12 @@ "keywords": [ | ||
"dependencies": { | ||
"loader-utils": "~0.2.2", | ||
"node-sass": "^1.0.1", | ||
"sass-graph": "^0.1.2" | ||
"loader-utils": "^0.2.5", | ||
"node-sass": "^1.2.2", | ||
"sass-graph": "git+https://github.com/lox/sass-graph.git#3a17328" | ||
}, | ||
"devDependencies": { | ||
"css-loader": "^0.9.0", | ||
"mocha": "^2.0.1", | ||
"raw-loader": "^0.5.1", | ||
"should": "^4.3.0", | ||
"webpack": "^1.4.0" | ||
} | ||
} |
@@ -31,4 +31,8 @@ # sass loader for [webpack](http://webpack.github.io/) | ||
test: /\.scss$/, | ||
loader: "style!css!sass?outputStyle=expanded&includePaths[]=" + | ||
(path.resolve(__dirname, './bower_components/bootstrap-sass-official')) | ||
// Query parameters are passed to node-sass | ||
loader: "style!css!sass?outputStyle=expanded&" + | ||
"includePaths[]=" + | ||
(path.resolve(__dirname, "./bower_components")) + "&" + | ||
"includePaths[]=" + | ||
(path.resolve(__dirname, "./node_modules")) | ||
} | ||
@@ -35,0 +39,0 @@ ] |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8986
18
131
56
4
1
3
1
- Removedcommander@2.1.0(transitive)
- Removedlodash@2.4.2(transitive)
- Removedsass-graph@0.1.2(transitive)
Updatedloader-utils@^0.2.5
Updatednode-sass@^1.2.2
Updatedsass-graph@git+https://github.com/lox/sass-graph.git#3a17328