less-loader
Advanced tools
Comparing version 0.7.3 to 0.7.4
13
index.js
@@ -23,2 +23,3 @@ /* | ||
var errored = false; | ||
var rootContext = this.context; | ||
less.Parser.fileLoader = function (url, currentFileInfo, callback) { | ||
@@ -29,3 +30,2 @@ var context = currentFileInfo.currentDirectory.replace(trailingSlash, ""); | ||
entryPath: currentFileInfo.entryPath, | ||
rootpath: currentFileInfo.rootpath, | ||
rootFilename: currentFileInfo.rootFilename | ||
@@ -45,3 +45,3 @@ }; | ||
filename = normalizePath(filename); | ||
updateFileInfo(newFileInfo, filename); | ||
updateFileInfo(newFileInfo, rootContext, filename); | ||
// The default (asynchronous) | ||
@@ -65,3 +65,3 @@ loaderContext.loadModule("-!" + __dirname + "/stringify.loader.js!" + filename, function(err, data) { | ||
filename = normalizePath(filename); | ||
updateFileInfo(newFileInfo, filename); | ||
updateFileInfo(newFileInfo, rootContext, filename); | ||
var data = fs.readFileSync(filename, 'utf-8'); | ||
@@ -84,3 +84,2 @@ callback(null, data, filename, newFileInfo); | ||
relativeUrls: true, | ||
rootpath: normalizePath(this.context) + "/", | ||
compress: !!this.minimize | ||
@@ -93,6 +92,6 @@ }, function(e, result) { | ||
function updateFileInfo(fileInfo, filename) { | ||
function updateFileInfo(fileInfo, rootContext, filename) { | ||
fileInfo.filename = filename; | ||
fileInfo.currentDirectory = path.dirname(filename); | ||
fileInfo.rootpath = path.relative(fileInfo.rootpath, fileInfo.currentDirectory).replace(/\\/g, "/") + "/"; | ||
fileInfo.rootpath = (path.relative(rootContext, fileInfo.currentDirectory).replace(/\\/g, "/") || ".") + "/"; | ||
} | ||
@@ -106,2 +105,2 @@ | ||
return path; | ||
} | ||
} |
{ | ||
"name": "less-loader", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "less loader module for webpack", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
7926
187