loader-utils
Advanced tools
Comparing version 0.2.11 to 0.2.12
12
index.js
@@ -91,4 +91,10 @@ var JSON5 = require("json5"); | ||
return JSON.stringify(splitted.map(function(part) { | ||
if(/^\/|^[A-Z]:/i.test(part) && context) | ||
return "./" + path.relative(context, part).replace(/\\/g, "/"); | ||
if(/^\/|^[A-Z]:/i.test(part) && context) { | ||
part = path.relative(context, part); | ||
if(/^[A-Z]:/i.test(part)) { | ||
return part; | ||
} else { | ||
return "./" + part.replace(/\\/g, "/"); | ||
} | ||
} | ||
return part; | ||
@@ -117,3 +123,3 @@ }).join("!")); | ||
// 3. it's some kind of url for a template | ||
if(/^data:|^(https?:)?\/\/|^[\{\}\[\]#*;,'§\$%&\(=?`´\^°<>]/.test(url)) return false; | ||
if(/^data:|^chrome-extension:|^(https?:)?\/\/|^[\{\}\[\]#*;,'§\$%&\(=?`´\^°<>]/.test(url)) return false; | ||
// 4. It's also not an request if root isn't set and it's a root-relative url | ||
@@ -120,0 +126,0 @@ if((root === undefined || root === false) && /^\//.test(url)) return false; |
{ | ||
"name": "loader-utils", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "utils for webpack loaders", |
@@ -79,3 +79,3 @@ # loader-utils | ||
Interpolates a filename template using multiple placeholders and/or a regular expression. | ||
The template and regular expresion are set as query params called `name` and `regExp` on the current loader's context. | ||
The template and regular expression are set as query params called `name` and `regExp` on the current loader's context. | ||
@@ -82,0 +82,0 @@ ```javascript |
14953
233