我收到以下错误:
Error: Could not find file: "..\..\..\..\source\node_modules\browserify\node_modules\browser-pack\_prelude.js"
at readFile (C:\Users\a0698714\Desktop\CPIC.UI.Web\node_modules\remap-istanbul\lib\remap.js:140:10)
尝试将coverage-remapped.json
转换为HTML报告时。
以下描述了我的文件:
使用Browserify + Uglify创建的名为CPIC.test.js
的UMD模块:
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.CPIC=e()}}(function(){return function e(n,t,o){function i(f,r){if(!t[f]){if(!n[f]){var s="function"==typeof require&&require;if(!r&&s)return s(f,!0);if(u)return u(f,!0);var c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[f]={exports:{}};n[f][0].call(d.exports,function(e){var t=n[f][1][e];return i(t?t:e)},d,d.exports,e,n,t,o)}return t[f].exports}for(var u="function"==typeof require&&require,f=0;f<o.length;f++)i(o[f]);return i}({1:[function(e,n,t){e("./components/engagement.test"),e("./components/questionnaire.test"),e("./components/question.test")},{"./components/engagement.test":2,"./components/question.test":3,"./components/questionnaire.test":4}],2:[function(e,n,t){chai.expect;describe("Engagement Test Suite \n",function(){it("It should ... \n",function(){})})},{}],3:[function(e,n,t){chai.expect;describe("Question Test Suite \n",function(){it("It should ... \n",function(){})})},{}],4:[function(e,n,t){chai.expect;describe("Questionnaire Test Suite \n",function(){it("It should ... \n",function(){})})},{}]},{},[1])(1)});
//# sourceMappingURL=CPIC.test.js.map
CPIC.test.js.map
的内容:
{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","test/CPIC.test.ts","CPIC.test.js","test/components/engagement.test.ts","test/components/question.test.ts","test/components/questionnaire.test.ts"],"names":["f","exports","module","define","amd","g","window","global","self","this","CPIC","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length",1,"./components/engagement.test","./components/question.test","./components/questionnaire.test",2,"chai","expect","describe","it",3,4],"mappings":"CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAAA,GAAA,mBAAAC,QAAAA,OAAA,mBAAAC,QAAAA,OAAA,mBAAAC,MAAAA,KAAAC,KAAAJ,EAAAK,KAAAV,MAAA,WAAA,MAAA,SAAAW,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAhB,GAAA,GAAAqB,OAAA,uBAAAL,EAAA,IAAA,MAAAhB,GAAAsB,KAAA,mBAAAtB,EAAA,GAAAuB,GAAAV,EAAAG,IAAAf,WAAAW,GAAAI,GAAA,GAAAQ,KAAAD,EAAAtB,QAAA,SAAAU,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,EAAAA,EAAAF,IAAAY,EAAAA,EAAAtB,QAAAU,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAf,QAAA,IAAA,GAAAmB,GAAA,kBAAAD,UAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAW,OAAAT,IAAAD,EAAAD,EAAAE,GAAA,OAAAD,KAAAW,GAAA,SAAAP,EAAAjB,EAAAD,GCAAkB,EAAO,gCACPA,EAAO,mCACPA,EAAO,gCCEJQ,+BAA+B,EAAEC,6BAA6B,EAAEC,kCAAkC,IAAIC,GAAG,SAASX,EAAQjB,EAAOD,GCHvH8B,KAAKC,MAIlBC,UAAS,2BAA4B,WAEnCC,GAAG,mBAAoB,qBDInBC,GAAG,SAAShB,EAAQjB,EAAOD,GEVpB8B,KAAKC,MAIlBC,UAAS,yBAA0B,WAEjCC,GAAG,mBAAoB,qBFWnBE,GAAG,SAASjB,EAAQjB,EAAOD,GGjBpB8B,KAAKC,MAIlBC,UAAS,8BAA+B,WAEtCC,GAAG,mBAAoB,0BHkBd,IAAI","file":"CPIC.test.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","import \"./components/engagement.test\";\r\nimport \"./components/questionnaire.test\";\r\nimport \"./components/question.test\";","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.CPIC = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\nrequire(\"./components/engagement.test\");\r\nrequire(\"./components/questionnaire.test\");\r\nrequire(\"./components/question.test\");\r\n},{\"./components/engagement.test\":2,\"./components/question.test\":3,\"./components/questionnaire.test\":4}],2:[function(require,module,exports){\n/// <reference path=\"../../src/app/interfaces/interfaces.d.ts\"/>\r\nvar expect = chai.expect;\r\ndescribe('Engagement Test Suite \\n', function () {\r\n it('It should ... \\n', function () {\r\n });\r\n});\r\n},{}],3:[function(require,module,exports){\n/// <reference path=\"../../src/app/interfaces/interfaces.d.ts\"/>\r\nvar expect = chai.expect;\r\ndescribe('Question Test Suite \\n', function () {\r\n it('It should ... \\n', function () {\r\n });\r\n});\r\n},{}],4:[function(require,module,exports){\n/// <reference path=\"../../src/app/interfaces/interfaces.d.ts\"/>\r\nvar expect = chai.expect;\r\ndescribe('Questionnaire Test Suite \\n', function () {\r\n it('It should ... \\n', function () {\r\n });\r\n});\r\n},{}]},{},[1])(1)\n});\n\n","/// <reference path=\"../../src/app/interfaces/interfaces.d.ts\"/>\r\nvar expect = chai.expect;\r\n\r\nimport { Engagement } from \"../../src/app/components/engagement\";\r\n\r\ndescribe('Engagement Test Suite \\n', () => {\r\n\r\n it('It should ... \\n', () => {\r\n //TODO\r\n });\r\n\r\n});\r\n","/// <reference path=\"../../src/app/interfaces/interfaces.d.ts\"/>\r\nvar expect = chai.expect;\r\n\r\nimport { Question } from \"../../src/app/components/question\";\r\n\r\ndescribe('Question Test Suite \\n', () => {\r\n\r\n it('It should ... \\n', () => {\r\n //TODO\r\n });\r\n\r\n});\r\n","/// <reference path=\"../../src/app/interfaces/interfaces.d.ts\"/>\r\nvar expect = chai.expect;\r\n\r\nimport { Questionnaire } from \"../../src/app/components/questionnaire\";\r\n\r\ndescribe('Questionnaire Test Suite \\n', () => {\r\n\r\n it('It should ... \\n', () => {\r\n //TODO\r\n });\r\n\r\n});\r\n"],"sourceRoot":"/source/"}
coverage-final.json
文件:
{
"C:\\Users\\x\\Desktop\\CPIC.UI.Web\\bundle\\test\\CPIC.test.js":{"path":"C:\\Users\\x\\Desktop\\CPIC.UI.Web\\bundle\\test\\CPIC.test.js","s":{"1":1,"2":1,"3":0,"4":1,"5":0,"6":1,"7":1,"8":1,"9":1,"10":5,"11":4,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":4,"20":4,"21":3,"22":3,"23":5,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1},"b":{"1":[0,1],"2":[1,0],"3":[0,1],"4":[1,0],"5":[1,0],"6":[0,0],"7":[0,0],"8":[4,1],"9":[0,4],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[3,0]},"f":{"1":1,"2":1,"3":1,"4":5,"5":3,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}},"2":{"name":"(anonymous_2)","line":1,"loc":{"start":{"line":1,"column":276},"end":{"line":1,"column":286}}},"3":{"name":"e","line":1,"loc":{"start":{"line":1,"column":294},"end":{"line":1,"column":311}}},"4":{"name":"i","line":1,"loc":{"start":{"line":1,"column":312},"end":{"line":1,"column":327}}},"5":{"name":"(anonymous_5)","line":1,"loc":{"start":{"line":1,"column":561},"end":{"line":1,"column":572}}},"6":{"name":"(anonymous_6)","line":1,"loc":{"start":{"line":1,"column":735},"end":{"line":1,"column":750}}},"7":{"name":"(anonymous_7)","line":1,"loc":{"start":{"line":1,"column":961},"end":{"line":1,"column":976}}},"8":{"name":"(anonymous_8)","line":1,"loc":{"start":{"line":1,"column":1025},"end":{"line":1,"column":1035}}},"9":{"name":"(anonymous_9)","line":1,"loc":{"start":{"line":1,"column":1058},"end":{"line":1,"column":1068}}},"10":{"name":"(anonymous_10)","line":1,"loc":{"start":{"line":1,"column":1082},"end":{"line":1,"column":1097}}},"11":{"name":"(anonymous_11)","line":1,"loc":{"start":{"line":1,"column":1144},"end":{"line":1,"column":1154}}},"12":{"name":"(anonymous_12)","line":1,"loc":{"start":{"line":1,"column":1177},"end":{"line":1,"column":1187}}},"13":{"name":"(anonymous_13)","line":1,"loc":{"start":{"line":1,"column":1201},"end":{"line":1,"column":1216}}},"14":{"name":"(anonymous_14)","line":1,"loc":{"start":{"line":1,"column":1268},"end":{"line":1,"column":1278}}},"15":{"name":"(anonymous_15)","line":1,"loc":{"start":{"line":1,"column":1301},"end":{"line":1,"column":1311}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":1336}},"2":{"start":{"line":1,"column":13},"end":{"line":1,"column":274}},"3":{"start":{"line":1,"column":69},"end":{"line":1,"column":88}},"4":{"start":{"line":1,"column":93},"end":{"line":1,"column":274}},"5":{"start":{"line":1,"column":134},"end":{"line":1,"column":147}},"6":{"start":{"line":1,"column":152},"end":{"line":1,"column":158}},"7":{"start":{"line":1,"column":158},"end":{"line":1,"column":273}},"8":{"start":{"line":1,"column":287},"end":{"line":1,"column":1333}},"9":{"start":{"line":1,"column":312},"end":{"line":1,"column":648}},"10":{"start":{"line":1,"column":328},"end":{"line":1,"column":628}},"11":{"start":{"line":1,"column":338},"end":{"line":1,"column":514}},"12":{"start":{"line":1,"column":348},"end":{"line":1,"column":390}},"13":{"start":{"line":1,"column":390},"end":{"line":1,"column":414}},"14":{"start":{"line":1,"column":399},"end":{"line":1,"column":414}},"15":{"start":{"line":1,"column":414},"end":{"line":1,"column":434}},"16":{"start":{"line":1,"column":419},"end":{"line":1,"column":434}},"17":{"start":{"line":1,"column":434},"end":{"line":1,"column":480}},"18":{"start":{"line":1,"column":480},"end":{"line":1,"column":513}},"19":{"start":{"line":1,"column":514},"end":{"line":1,"column":538}},"20":{"start":{"line":1,"column":538},"end":{"line":1,"column":627}},"21":{"start":{"line":1,"column":573},"end":{"line":1,"column":590}},"22":{"start":{"line":1,"column":590},"end":{"line":1,"column":605}},"23":{"start":{"line":1,"column":628},"end":{"line":1,"column":647}},"24":{"start":{"line":1,"column":648},"end":{"line":1,"column":721}},"25":{"start":{"line":1,"column":713},"end":{"line":1,"column":721}},"26":{"start":{"line":1,"column":721},"end":{"line":1,"column":729}},"27":{"start":{"line":1,"column":751},"end":{"line":1,"column":853}},"28":{"start":{"line":1,"column":977},"end":{"line":1,"column":989}},"29":{"start":{"line":1,"column":989},"end":{"line":1,"column":1073}},"30":{"start":{"line":1,"column":1036},"end":{"line":1,"column":1071}},"31":{"start":{"line":1,"column":1098},"end":{"line":1,"column":1110}},"32":{"start":{"line":1,"column":1110},"end":{"line":1,"column":1192}},"33":{"start":{"line":1,"column":1155},"end":{"line":1,"column":1190}},"34":{"start":{"line":1,"column":1217},"end":{"line":1,"column":1229}},"35":{"start":{"line":1,"column":1229},"end":{"line":1,"column":1316}},"36":{"start":{"line":1,"column":1279},"end":{"line":1,"column":1314}}},"branchMap":{"1":{"line":1,"type":"if","locations":[{"start":{"line":1,"column":13},"end":{"line":1,"column":13}},{"start":{"line":1,"column":13},"end":{"line":1,"column":13}}]},"2":{"line":1,"type":"binary-expr","locations":[{"start":{"line":1,"column":16},"end":{"line":1,"column":40}},{"start":{"line":1,"column":42},"end":{"line":1,"column":68}}]},"3":{"line":1,"type":"if","locations":[{"start":{"line":1,"column":93},"end":{"line":1,"column":93}},{"start":{"line":1,"column":93},"end":{"line":1,"column":93}}]},"4":{"line":1,"type":"binary-expr","locations":[{"start":{"line":1,"column":96},"end":{"line":1,"column":121}},{"start":{"line":1,"column":123},"end":{"line":1,"column":133}}]},"5":{"line":1,"type":"cond-expr","locations":[{"start":{"line":1,"column":187},"end":{"line":1,"column":193}},{"start":{"line":1,"column":194},"end":{"line":1,"column":262}}]},"6":{"line":1,"type":"cond-expr","locations":[{"start":{"line":1,"column":221},"end":{"line":1,"column":227}},{"start":{"line":1,"column":228},"end":{"line":1,"column":262}}]},"7":{"line":1,"type":"cond-expr","locations":[{"start":{"line":1,"column":253},"end":{"line":1,"column":257}},{"start":{"line":1,"column":258},"end":{"line":1,"column":262}}]},"8":{"line":1,"type":"if","locations":[{"start":{"line":1,"column":328},"end":{"line":1,"column":328}},{"start":{"line":1,"column":328},"end":{"line":1,"column":328}}]},"9":{"line":1,"type":"if","locations":[{"start":{"line":1,"column":338},"end":{"line":1,"column":338}},{"start":{"line":1,"column":338},"end":{"line":1,"column":338}}]},"10":{"line":1,"type":"binary-expr","locations":[{"start":{"line":1,"column":354},"end":{"line":1,"column":380}},{"start":{"line":1,"column":382},"end":{"line":1,"column":389}}]},"11":{"line":1,"type":"if","locations":[{"start":{"line":1,"column":390},"end":{"line":1,"column":390}},{"start":{"line":1,"column":390},"end":{"line":1,"column":390}}]},"12":{"line":1,"type":"binary-expr","locations":[{"start":{"line":1,"column":393},"end":{"line":1,"column":395}},{"start":{"line":1,"column":397},"end":{"line":1,"column":398}}]},"13":{"line":1,"type":"if","locations":[{"start":{"line":1,"column":414},"end":{"line":1,"column":414}},{"start":{"line":1,"column":414},"end":{"line":1,"column":414}}]},"14":{"line":1,"type":"cond-expr","locations":[{"start":{"line":1,"column":601},"end":{"line":1,"column":602}},{"start":{"line":1,"column":603},"end":{"line":1,"column":604}}]}},"l":{"1":5}}}
coverage-final.json
(重新映射)文件的内容:
{"..\\..\\..\\..\\source\\node_modules\\browserify\\node_modules\\browser-pack\\_prelude.js":{"path":"..\\..\\..\\..\\source\\node_modules\\browserify\\node_modules\\browser-pack\\_prelude.js","statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":-1}}},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":-1}}}},"branchMap":{"1":{"line":1,"type":"if","locations":[{"start":{"line":1,"column":0},"end":{"line":1,"column":-1}},{"start":{"line":1,"column":0},"end":{"line":1,"column":-1}}]}},"s":{"1":36},"b":{"1":[10,7]},"f":{"1":12},"l":{"1":36}},"..\\..\\..\\..\\source\\CPIC.test.js":{"path":"..\\..\\..\\..\\source\\CPIC.test.js","statementMap":{},"fnMap":{"1":{"name":"(anonymous_7)","line":5,"loc":{"start":{"line":5,"column":108},"end":{"line":5,"column":132}}},"2":{"name":"(anonymous_10)","line":12,"loc":{"start":{"line":12,"column":9},"end":{"line":12,"column":33}}},"3":{"name":"(anonymous_13)","line":19,"loc":{"start":{"line":19,"column":9},"end":{"line":19,"column":33}}}},"branchMap":{},"s":{},"b":{},"f":{"1":1,"2":1,"3":1},"l":{}},"..\\..\\..\\..\\source\\test\\components\\engagement.test.ts":{"path":"..\\..\\..\\..\\source\\test\\components\\engagement.test.ts","statementMap":{"1":{"start":{"line":2,"column":13},"end":{"line":6,"column":0}},"2":{"start":{"line":6,"column":0},"end":{"line":8,"column":25}},"3":{"start":{"line":8,"column":2},"end":{"line":8,"column":25}}},"fnMap":{"1":{"name":"(anonymous_8)","line":6,"loc":{"start":{"line":6,"column":37},"end":{"line":8,"column":1}}},"2":{"name":"(anonymous_9)","line":8,"loc":{"start":{"line":8,"column":25},"end":{"line":12,"column":5}}}},"branchMap":{},"s":{"1":1,"2":1,"3":1},"b":{},"f":{"1":1,"2":1},"l":{"2":1,"6":1,"8":1}},"..\\..\\..\\..\\source\\test\\components\\question.test.ts":{"path":"..\\..\\..\\..\\source\\test\\components\\question.test.ts","statementMap":{"1":{"start":{"line":2,"column":13},"end":{"line":6,"column":0}},"2":{"start":{"line":6,"column":0},"end":{"line":8,"column":25}},"3":{"start":{"line":8,"column":2},"end":{"line":8,"column":25}}},"fnMap":{"1":{"name":"(anonymous_11)","line":6,"loc":{"start":{"line":6,"column":35},"end":{"line":8,"column":1}}},"2":{"name":"(anonymous_12)","line":8,"loc":{"start":{"line":8,"column":25},"end":{"line":19,"column":5}}}},"branchMap":{},"s":{"1":1,"2":1,"3":1},"b":{},"f":{"1":1,"2":1},"l":{"2":1,"6":1,"8":1}},"..\\..\\..\\..\\source\\test\\components\\questionnaire.test.ts":{"path":"..\\..\\..\\..\\source\\test\\components\\questionnaire.test.ts","statementMap":{"1":{"start":{"line":2,"column":13},"end":{"line":6,"column":0}},"2":{"start":{"line":6,"column":0},"end":{"line":8,"column":25}},"3":{"start":{"line":8,"column":2},"end":{"line":8,"column":25}}},"fnMap":{"1":{"name":"(anonymous_14)","line":6,"loc":{"start":{"line":6,"column":40},"end":{"line":8,"column":1}}},"2":{"name":"(anonymous_15)","line":8,"loc":{"start":{"line":8,"column":25},"end":{"line":26,"column":10}}}},"branchMap":{},"s":{"1":1,"2":1,"3":1},"b":{},"f":{"1":1,"2":1},"l":{"2":1,"6":1,"8":1}},"..\\..\\..\\..\\source\\test\\CPIC.test.ts":{"path":"..\\..\\..\\..\\source\\test\\CPIC.test.ts","statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":3,"column":7}}},"fnMap":{},"branchMap":{},"s":{"1":1},"b":{},"f":{},"l":{"1":1}}}
/coverage/coverage-remapped/coverage-final.json
文件中的路径错误:
"..\\..\\..\\..\\source\\test\\components\\questionnaire.test.ts"
应该是(通知已删除test
文件夹):
"..\\..\\..\\..\\source\\components\\questionnaire.test.ts"
我不确定它应该有多少个父文件夹:
"..\\..\\..\\..\\"
捆绑文件及其源映射可以正常工作,但重映射覆盖率不会。
我猜是因为源地图文件不使用绝对路径或相对路径:
//# sourceMappingURL=CPIC.test.js.map
但我不确定如何修复它。有什么想法吗?
生成/coverage/coverage-remapped/coverage-final.json
文件的gulp任务:
gulp.task("coverage-remap", function () {
var input = "coverage/PhantomJS 1.9.8 (Windows 7 0.0.0)/coverage-final.json";
var output = "coverage/coverage-remapped";
return gulp.src(input)
.pipe(remapIstanbul())
.pipe(gulp.dest(output));
});
答案 0 :(得分:0)
目前remap-istanbul
不支持内联源地图和内联源,这就是它失败的原因。可以要求作为增强功能。
我认为问题的根源虽然不使用内联源,但是发出的文件中的URL报告为:
//# sourceMappingURL=CPIC.test.js.map
我认为正确找到的那个文件说源是:
"node_modules/browserify/node_modules/browser-pack/_prelude.js"
以及:
"test/CPIC.test.ts"
"CPIC.test.js"
"test/components/engagement.test.ts"
"test/components/question.test.ts"
"test/components/questionnaire.test.ts"
从remap-istanbul
运行的地方,它将查找覆盖的文件(C:\\Users\\x\\Desktop\\CPIC.UI.Web\\bundle\\test\\CPIC.test.js
),然后加载覆盖地图CPIC.test.js.map
,然后相对于地图的cwd,尝试找到源映射中列出的源文件。它无法解决导致错误的第一个问题,并且基本上是在尽最大努力(这也会破坏重新映射的路径)。
有basePath
option,允许&#34;重新基础&#34;来源的地方。这可能会解决这个问题,在很多方面你超出了remap-istanbul
的设计限制,你需要在生成的代码被移动之后复杂地重新映射文件。哪里有几个&#34;层&#34;解开回到我们开始的地方。