File tree Expand file tree Collapse file tree 3 files changed +18
-12
lines changed
Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 11language : node_js
22node_js :
3- - " 0.10 "
3+ - " 12.18.2 "
Original file line number Diff line number Diff line change 66var SourceMap = require ( 'source-map' ) . SourceMapGenerator ;
77var SourceMapConsumer = require ( 'source-map' ) . SourceMapConsumer ;
88var sourceMapResolve = require ( 'source-map-resolve' ) ;
9- var urix = require ( 'urix' ) ;
109var fs = require ( 'fs' ) ;
1110var path = require ( 'path' ) ;
1211
@@ -16,6 +15,14 @@ var path = require('path');
1615
1716module . exports = mixin ;
1817
18+ /**
19+ * Ensure Windows-style paths are formatted properly
20+ */
21+
22+ const makeFriendlyPath = function ( aPath ) {
23+ return path . sep === "\\" ? aPath . replace ( / \\ / g, "/" ) . replace ( / ^ [ a - z ] : \/ ? / i, "/" ) : aPath ;
24+ }
25+
1926/**
2027 * Mixin source map support into `compiler`.
2128 *
@@ -56,7 +63,7 @@ exports.updatePosition = function(str) {
5663
5764exports . emit = function ( str , pos ) {
5865 if ( pos ) {
59- var sourceFile = urix ( pos . source || 'source.css' ) ;
66+ var sourceFile = makeFriendlyPath ( pos . source || 'source.css' ) ;
6067
6168 this . map . addMapping ( {
6269 source : sourceFile ,
@@ -107,7 +114,7 @@ exports.applySourceMaps = function() {
107114 if ( originalMap ) {
108115 var map = new SourceMapConsumer ( originalMap . map ) ;
109116 var relativeTo = originalMap . sourcesRelativeTo ;
110- this . map . applySourceMap ( map , file , urix ( path . dirname ( relativeTo ) ) ) ;
117+ this . map . applySourceMap ( map , file , makeFriendlyPath ( path . dirname ( relativeTo ) ) ) ;
111118 }
112119 }
113120 } , this ) ;
Original file line number Diff line number Diff line change 99 " Readme.md"
1010 ],
1111 "dependencies" : {
12- "inherits" : " ^2.0.3 " ,
12+ "inherits" : " ^2.0.4 " ,
1313 "source-map" : " ^0.6.1" ,
14- "source-map-resolve" : " ^0.5.2" ,
15- "urix" : " ^0.1.0"
14+ "source-map-resolve" : " ^0.6.0"
1615 },
1716 "devDependencies" : {
18- "mocha" : " ^1.21.3 " ,
19- "should" : " ^4.0.4 " ,
20- "matcha" : " ^0.5 .0" ,
21- "bytes" : " ^1.0 .0"
17+ "mocha" : " ^8.0.1 " ,
18+ "should" : " ^13.2.3 " ,
19+ "matcha" : " ^0.7 .0" ,
20+ "bytes" : " ^3.1 .0"
2221 },
2322 "scripts" : {
2423 "benchmark" : " matcha" ,
25- "test" : " mocha --require should --reporter spec --bail test/*.js"
24+ "test" : " mocha --require should --reporter spec test/*.js"
2625 },
2726 "author" : " TJ Holowaychuk <tj@vision-media.ca>" ,
2827 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments