vendor/lib/functions/url.js in stylus-source-0.35.1 vs vendor/lib/functions/url.js in stylus-source-0.36.0
- old
+ new
@@ -8,10 +8,11 @@
/**
* Module dependencies.
*/
var Compiler = require('../visitor/compiler')
+ , events = require('../renderer').events
, nodes = require('../nodes')
, parse = require('url').parse
, extname = require('path').extname
, utils = require('../utils')
, fs = require('fs');
@@ -82,10 +83,17 @@
// Lookup
var found = utils.lookup(url.pathname, paths);
// Failed to lookup
- if (!found) return literal;
+ if (!found) {
+ events.emit(
+ 'file not found'
+ , 'File ' + literal + ' could not be found, literal url retained!'
+ );
+
+ return literal;
+ }
// Read data
buf = fs.readFileSync(found);
// To large