less-loader
Advanced tools
Comparing version 0.1.1 to 0.1.2
36
index.js
@@ -8,2 +8,6 @@ /* | ||
var fs = require("fs"); | ||
function formatLessError(e, filename) { | ||
return new Error(e.message + "\n @ " + filename + | ||
" (line " + e.line + ", column " + e.column + ")"); | ||
} | ||
module.exports = function(input) { | ||
@@ -25,9 +29,17 @@ this.cacheable && this.cacheable(); | ||
new(less.Parser)({ | ||
filename: filename, | ||
paths: [], | ||
compress: env.compress | ||
}).parse(data, function (e, root) { | ||
callback(e, root, data); | ||
}); | ||
try { | ||
new(less.Parser)({ | ||
// filename: filename, | ||
paths: [], | ||
compress: env.compress | ||
}).parse(data, function (e, root) { | ||
callback(e, root, data); | ||
}); | ||
} catch(e) { | ||
try { | ||
callback(e); | ||
} catch(e) { | ||
options.callback(formatLessError(e, filename)); | ||
} | ||
} | ||
}); | ||
@@ -39,3 +51,3 @@ } else { | ||
new(less.Parser)({ | ||
filename: filename, | ||
// filename: filename, | ||
paths: [], | ||
@@ -47,3 +59,7 @@ compress: env.compress | ||
} catch(e) { | ||
callback(e); | ||
try { | ||
callback(e); | ||
} catch(e) { | ||
options.callback(formatLessError(e, filename)); | ||
} | ||
} | ||
@@ -54,3 +70,3 @@ } | ||
var resultcb = this.callback; | ||
less.render(input, { | ||
@@ -57,0 +73,0 @@ filename: this.filenames[0], |
{ | ||
"name": "less-loader", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "less loader module for webpack", |
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
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
2621
77
1