Comparing version
@@ -9,3 +9,2 @@ | ||
var sourceMapResolve = require('source-map-resolve'); | ||
var urix = require('urix'); | ||
var fs = require('fs'); | ||
@@ -21,2 +20,10 @@ var path = require('path'); | ||
/** | ||
* Ensure Windows-style paths are formatted properly | ||
*/ | ||
const makeFriendlyPath = function(aPath) { | ||
return path.sep === "\\" ? aPath.replace(/\\/g, "/").replace(/^[a-z]:\/?/i, "/") : aPath; | ||
} | ||
/** | ||
* Mixin source map support into `compiler`. | ||
@@ -61,3 +68,3 @@ * | ||
if (pos) { | ||
var sourceFile = urix(pos.source || 'source.css'); | ||
var sourceFile = makeFriendlyPath(pos.source || 'source.css'); | ||
@@ -113,3 +120,3 @@ this.map.addMapping({ | ||
var relativeTo = originalMap.sourcesRelativeTo; | ||
this.map.applySourceMap(map, file, urix(path.dirname(relativeTo))); | ||
this.map.applySourceMap(map, file, makeFriendlyPath(path.dirname(relativeTo))); | ||
} | ||
@@ -116,0 +123,0 @@ } |
{ | ||
"name": "css", | ||
"version": "2.2.4", | ||
"version": "3.0.0", | ||
"description": "CSS parser / stringifier", | ||
@@ -12,16 +12,15 @@ "main": "index", | ||
"dependencies": { | ||
"inherits": "^2.0.3", | ||
"inherits": "^2.0.4", | ||
"source-map": "^0.6.1", | ||
"source-map-resolve": "^0.5.2", | ||
"urix": "^0.1.0" | ||
"source-map-resolve": "^0.6.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^1.21.3", | ||
"should": "^4.0.4", | ||
"matcha": "^0.5.0", | ||
"bytes": "^1.0.0" | ||
"mocha": "^8.0.1", | ||
"should": "^13.2.3", | ||
"matcha": "^0.7.0", | ||
"bytes": "^3.1.0" | ||
}, | ||
"scripts": { | ||
"benchmark": "matcha", | ||
"test": "mocha --require should --reporter spec --bail test/*.js" | ||
"test": "mocha --require should --reporter spec test/*.js" | ||
}, | ||
@@ -28,0 +27,0 @@ "author": "TJ Holowaychuk <tj@vision-media.ca>", |
35471
0.47%3
-25%1014
0.5%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated