diff --git a/.gitignore b/.gitignore index 648ea07f..073809d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules coverage npm-debug.log +/nbproject/private/ diff --git a/lib/loader.js b/lib/loader.js index ca856cd3..2a63819f 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -14,6 +14,7 @@ module.exports = function(content, map) { var callback = this.async(); var query = loaderUtils.getOptions(this) || {}; var root = query.root; + var rel = query.rel; var moduleMode = query.modules || query.module; var camelCaseKeys = query.camelCase || query.camelcase; var sourceMap = query.sourceMap || false; @@ -98,6 +99,9 @@ module.exports = function(content, map) { url.substr(idx); } urlRequest = url; + if(!(/^(?:\/|[a-z0-9]+:\/\/)/.test(urlRequest)) && typeof rel !== 'undefined' ) { + urlRequest = rel + "/" + urlRequest; + } return "\" + require(" + loaderUtils.stringifyRequest(this, urlRequest) + ") + \""; }.bind(this)); }