stylus-loader
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -210,6 +210,18 @@ var path = require('path'); | ||
var functionsPath = path.join( | ||
__dirname, '../node_modules/stylus/lib/functions/index.styl' | ||
); | ||
var functionsSource = readFile(functionsPath) | ||
// Resolve functions in a promise wrapper to catch any errors from resolving. | ||
var functionsPath = | ||
new when.Promise(function(resolve) { | ||
resolve(require.resolve('stylus/lib/functions/index.styl')); | ||
}) | ||
.catch(function() { return ''; }); | ||
var functionsSource = functionsPath | ||
.then(readFile) | ||
.catch(function(error) { | ||
// Ignore error if functions/index.styl doesn't exist. | ||
if (error.code !== 'ENOENT') { | ||
throw error; | ||
} | ||
return ''; | ||
}) | ||
.then(String); | ||
@@ -221,3 +233,5 @@ | ||
.then(function(functionsSource) { | ||
sources[functionsPath] = functionsSource; | ||
if (functionsSource) { | ||
sources[functionsPath] = functionsSource; | ||
} | ||
}) | ||
@@ -224,0 +238,0 @@ // Pass through the source given to this function. |
{ | ||
"name": "stylus-loader", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Stylus loader for webpack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
27590
610