stylus-loader
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -21,2 +21,3 @@ var loaderUtils = require('loader-utils'); | ||
options.import = options.import || stylusOptions.import || []; | ||
options.define = options.define || stylusOptions.define || []; | ||
@@ -73,7 +74,9 @@ if (options.sourceMap != null) { | ||
var boundResolvers = PathCache.resolvers(options, this.resolve); | ||
PathCache.createFromFile(boundResolvers, {}, options.filename) | ||
PathCache.createFromFile(boundResolvers, {}, source, options.filename) | ||
.then(function(importPathCache) { | ||
// CachedPathEvaluator will use this PathCache to find its dependencies. | ||
options.cache = importPathCache; | ||
importPathCache.allDeps().forEach(self.addDependency); | ||
importPathCache.allDeps().forEach(function(f) { | ||
self.addDependency(path.normalize(f)); | ||
}); | ||
@@ -80,0 +83,0 @@ styl.render(function(err, css) { |
@@ -163,7 +163,11 @@ var path = require('path'); | ||
// Load a file at fullPath, resolve all of it's imports and report for those. | ||
function resolveFileDeep(resolvers, contexts, fullPath) { | ||
function resolveFileDeep(resolvers, contexts, source, fullPath) { | ||
contexts = contexts || {}; | ||
var nestResolve = resolveFileDeep.bind(null, resolvers, contexts); | ||
var nestResolve = resolveFileDeep.bind(null, resolvers, contexts, null); | ||
var context = path.dirname(fullPath); | ||
return readFile(fullPath, 'utf8') | ||
return when | ||
.try(function() { | ||
if (typeof source === 'string') { return source; } | ||
return readFile(fullPath, 'utf8'); | ||
}) | ||
.then(listImports) | ||
@@ -170,0 +174,0 @@ .then(resolveMany.bind(null, resolvers, context)) |
{ | ||
"name": "stylus-loader", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Stylus loader for webpack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
29582
631