less-loader
Advanced tools
Comparing version 0.2.2 to 0.5.0
22
index.js
@@ -14,5 +14,4 @@ /* | ||
this.cacheable && this.cacheable(); | ||
var options = this; | ||
var loaderContext = this; | ||
var cb = this.async(); | ||
var resolve = cb ? options.resolve : options.resolve.sync; | ||
var errored = false; | ||
@@ -23,10 +22,10 @@ less.Parser.importer = function (file, paths, callback, env) { | ||
if(cb) { | ||
options.resolve(context, moduleName, function(err, filename) { | ||
loaderContext.resolve(context, moduleName, function(err, filename) { | ||
if(err) { | ||
if(!errored) | ||
options.callback(err); | ||
loaderContext.callback(err); | ||
errored = true; | ||
return; | ||
} | ||
options.dependency && options.dependency(filename); | ||
loaderContext.dependency && loaderContext.dependency(filename); | ||
// The default (asynchron) | ||
@@ -48,3 +47,3 @@ fs.readFile(filename, 'utf-8', function(e, data) { | ||
} catch(e) { | ||
options.callback(formatLessError(e, filename)); | ||
loaderContext.callback(formatLessError(e, filename)); | ||
} | ||
@@ -55,3 +54,3 @@ } | ||
} else { | ||
var filename = options.resolve.sync(context, moduleName); | ||
var filename = loaderContext.resolveSync(context, moduleName); | ||
// Make it synchron | ||
@@ -71,3 +70,3 @@ try { | ||
} catch(e) { | ||
options.callback(formatLessError(e, filename)); | ||
loaderContext.callback(formatLessError(e, filename)); | ||
} | ||
@@ -80,7 +79,8 @@ } | ||
less.render(input, { | ||
filename: this.filenames[0], | ||
filename: this.resource, | ||
paths: [], | ||
compress: !!this.minimize | ||
}, function(e, result) { | ||
resultcb(e, e ? null : "module.exports =\n\t" + JSON.stringify(result) + ";"); | ||
if(e) return resultcs(e); | ||
resultcb(null, result); | ||
}); | ||
@@ -94,2 +94,2 @@ } | ||
} | ||
module.exports.seperableIfResolve = true; | ||
module.exports.seperableIfResolve = true; |
{ | ||
"name": "less-loader", | ||
"version": "0.2.2", | ||
"version": "0.5.0", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -14,4 +14,3 @@ "description": "less loader module for webpack", | ||
} | ||
], | ||
"license": "MIT" | ||
] | ||
} |
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
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
86
2950