Skip to content

Commit 3229b3c

Browse files
authoredNov 4, 2020
fix: sources in source maps have relative paths (#1219)
1 parent 98950ef commit 3229b3c

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed
 

‎src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ function normalizeSourceMapForRuntime(map, loaderContext) {
484484
path.relative(loaderContext.rootContext, absoluteSource)
485485
);
486486

487-
return `webpack://${contextifyPath}`;
487+
return `webpack://./${contextifyPath}`;
488488
});
489489
}
490490

‎test/__snapshots__/sourceMap-option.test.js.snap

+33-33
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ import ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \\"../../../src/runtime/cssWit
176176
import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\";
177177
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
178178
// Module
179-
___CSS_LOADER_EXPORT___.push([module.id, \\".foo {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/with-query.css\\"],\\"names\\":[],\\"mappings\\":\\"AAAA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\".foo {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
179+
___CSS_LOADER_EXPORT___.push([module.id, \\".foo {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/with-query.css\\"],\\"names\\":[],\\"mappings\\":\\"AAAA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\".foo {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
180180
// Exports
181181
export default ___CSS_LOADER_EXPORT___;
182182
"
@@ -196,7 +196,7 @@ Array [
196196
"names": Array [],
197197
"sourceRoot": "",
198198
"sources": Array [
199-
"webpack://source-map/with-query.css",
199+
"webpack://./source-map/with-query.css",
200200
],
201201
"sourcesContent": Array [
202202
".foo {
@@ -222,7 +222,7 @@ import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??[ident
222222
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
223223
___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);
224224
// Module
225-
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://test/fixtures/source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
225+
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./test/fixtures/source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
226226
// Exports
227227
export default ___CSS_LOADER_EXPORT___;
228228
"
@@ -242,7 +242,7 @@ Array [
242242
"names": Array [],
243243
"sourceRoot": "",
244244
"sources": Array [
245-
"webpack://test/fixtures/source-map/nested/nested.css",
245+
"webpack://./test/fixtures/source-map/nested/nested.css",
246246
],
247247
"sourcesContent": Array [
248248
".nested {
@@ -265,7 +265,7 @@ Array [
265265
"names": Array [],
266266
"sourceRoot": "",
267267
"sources": Array [
268-
"webpack://test/fixtures/source-map/basic.css",
268+
"webpack://./test/fixtures/source-map/basic.css",
269269
],
270270
"sourcesContent": Array [
271271
"@import \\"./nested/nested.css\\";
@@ -305,8 +305,8 @@ Object {
305305
"names": Array [],
306306
"sourceRoot": "",
307307
"sources": Array [
308-
"webpack:///test/fixtures/source-map/nested/nested.css",
309-
"webpack:///test/fixtures/source-map/basic.css",
308+
"webpack:///./test/fixtures/source-map/nested/nested.css",
309+
"webpack:///./test/fixtures/source-map/basic.css",
310310
],
311311
"sourcesContent": Array [
312312
".nested {
@@ -348,8 +348,8 @@ Object {
348348
"names": Array [],
349349
"sourceRoot": "",
350350
"sources": Array [
351-
"webpack:///source-map/nested/nested.css",
352-
"webpack:///source-map/basic.css",
351+
"webpack:///./source-map/nested/nested.css",
352+
"webpack:///./source-map/basic.css",
353353
],
354354
"sourcesContent": Array [
355355
".nested {
@@ -379,7 +379,7 @@ import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??[ident
379379
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
380380
___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);
381381
// Module
382-
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
382+
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
383383
// Exports
384384
export default ___CSS_LOADER_EXPORT___;
385385
"
@@ -399,7 +399,7 @@ Array [
399399
"names": Array [],
400400
"sourceRoot": "",
401401
"sources": Array [
402-
"webpack://source-map/nested/nested.css",
402+
"webpack://./source-map/nested/nested.css",
403403
],
404404
"sourcesContent": Array [
405405
".nested {
@@ -422,7 +422,7 @@ Array [
422422
"names": Array [],
423423
"sourceRoot": "",
424424
"sources": Array [
425-
"webpack://source-map/basic.css",
425+
"webpack://./source-map/basic.css",
426426
],
427427
"sourcesContent": Array [
428428
"@import \\"./nested/nested.css\\";
@@ -450,7 +450,7 @@ import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??[ident
450450
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
451451
___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);
452452
// Module
453-
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/basic-1.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
453+
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/basic-1.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
454454
// Exports
455455
export default ___CSS_LOADER_EXPORT___;
456456
"
@@ -470,7 +470,7 @@ Array [
470470
"names": Array [],
471471
"sourceRoot": "",
472472
"sources": Array [
473-
"webpack://source-map/nested/nested.css",
473+
"webpack://./source-map/nested/nested.css",
474474
],
475475
"sourcesContent": Array [
476476
".nested {
@@ -493,7 +493,7 @@ Array [
493493
"names": Array [],
494494
"sourceRoot": "",
495495
"sources": Array [
496-
"webpack://source-map/basic-1.css",
496+
"webpack://./source-map/basic-1.css",
497497
],
498498
"sourcesContent": Array [
499499
"@import \\"./nested/nested.css\\";
@@ -519,7 +519,7 @@ import ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \\"../../../src/runtime/cssWit
519519
import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\";
520520
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
521521
// Module
522-
___CSS_LOADER_EXPORT___.push([module.id, \\"body {\\\\n font: 100% Helvetica, sans-serif;\\\\n color: #333;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/base.less\\"],\\"names\\":[],\\"mappings\\":\\"AAGA;EACE,gCAAA;EACA,WAAA;AAFF\\",\\"sourcesContent\\":[\\"@font-stack: Helvetica, sans-serif;\\\\n@primary-color: #333;\\\\n\\\\nbody {\\\\n font: 100% @font-stack;\\\\n color: @primary-color;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
522+
___CSS_LOADER_EXPORT___.push([module.id, \\"body {\\\\n font: 100% Helvetica, sans-serif;\\\\n color: #333;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/base.less\\"],\\"names\\":[],\\"mappings\\":\\"AAGA;EACE,gCAAA;EACA,WAAA;AAFF\\",\\"sourcesContent\\":[\\"@font-stack: Helvetica, sans-serif;\\\\n@primary-color: #333;\\\\n\\\\nbody {\\\\n font: 100% @font-stack;\\\\n color: @primary-color;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
523523
// Exports
524524
export default ___CSS_LOADER_EXPORT___;
525525
"
@@ -540,7 +540,7 @@ Array [
540540
"names": Array [],
541541
"sourceRoot": "",
542542
"sources": Array [
543-
"webpack://source-map/base.less",
543+
"webpack://./source-map/base.less",
544544
],
545545
"sourcesContent": Array [
546546
"@font-stack: Helvetica, sans-serif;
@@ -570,7 +570,7 @@ import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??[ident
570570
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
571571
___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);
572572
// Module
573-
___CSS_LOADER_EXPORT___.push([module.id, \\":root {\\\\n --fontSize: 1rem;\\\\n --mainColor: rgba(18,52,86,0.47059);\\\\n --secondaryColor: rgba(102, 51, 153, 0.9);\\\\n}\\\\n\\\\nhtml {\\\\n overflow-x: hidden;\\\\n overflow-y: auto;\\\\n overflow: hidden auto;\\\\n}\\\\n\\\\n@media (max-width: 50rem) {\\\\n body {\\\\n color: rgba(18,52,86,0.47059);\\\\n color: var(--mainColor);\\\\n font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;\\\\n font-size: 1rem;\\\\n font-size: var(--fontSize);\\\\n line-height: calc(1rem * 1.5);\\\\n line-height: calc(var(--fontSize) * 1.5);\\\\n word-wrap: break-word;\\\\n padding-left: calc(1rem / 2 + 1px);\\\\n padding-right: calc(1rem / 2 + 1px);\\\\n padding-left: calc(var(--fontSize) / 2 + 1px);\\\\n padding-right: calc(var(--fontSize) / 2 + 1px);\\\\n }\\\\n}\\\\n\\\\nh1,h2,h3,h4,h5,h6 {\\\\n margin-top: 0;\\\\n margin-bottom: 0;\\\\n}\\\\n\\\\na {\\\\n color: rgba(0, 0, 255, 0.9)\\\\n}\\\\n\\\\na:hover {\\\\n color: #639;\\\\n }\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/basic.postcss.css\\"],\\"names\\":[],\\"mappings\\":\\"AAKA;EACE,gBAAgB;EAChB,mCAAsB;EACtB,yCAA4C;AAC9C;;AAEA;EACE,kBAAqB;EAArB,gBAAqB;EAArB,qBAAqB;AACvB;;AAEA;EACE;IACE,6BAAuB;IAAvB,uBAAuB;IACvB,iGAAsB;IACtB,eAA0B;IAA1B,0BAA0B;IAC1B,6BAAwC;IAAxC,wCAAwC;IACxC,qBAAyB;IACzB,kCAA+C;IAA/C,mCAA+C;IAA/C,6CAA+C;IAA/C,8CAA+C;EACjD;AACF;;AAEA;EACE,aAAe;EAAf,gBAAe;AACjB;;AAEA;EACE;AAKF;;AAHA;GACG,WAAoB;CACtB\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.postcss.css\\\\\\";\\\\n\\\\n@custom-media --viewport-medium (width <= 50rem);\\\\n@custom-selector :--heading h1, h2, h3, h4, h5, h6;\\\\n\\\\n:root {\\\\n --fontSize: 1rem;\\\\n --mainColor: #12345678;\\\\n --secondaryColor: lab(32.5 38.5 -47.6 / 90%);\\\\n}\\\\n\\\\nhtml {\\\\n overflow: hidden auto;\\\\n}\\\\n\\\\n@media (--viewport-medium) {\\\\n body {\\\\n color: var(--mainColor);\\\\n font-family: system-ui;\\\\n font-size: var(--fontSize);\\\\n line-height: calc(var(--fontSize) * 1.5);\\\\n overflow-wrap: break-word;\\\\n padding-inline: calc(var(--fontSize) / 2 + 1px);\\\\n }\\\\n}\\\\n\\\\n:--heading {\\\\n margin-block: 0;\\\\n}\\\\n\\\\na {\\\\n color: rgb(0 0 100% / 90%);\\\\n\\\\n&:hover {\\\\n color: rebeccapurple;\\\\n }\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
573+
___CSS_LOADER_EXPORT___.push([module.id, \\":root {\\\\n --fontSize: 1rem;\\\\n --mainColor: rgba(18,52,86,0.47059);\\\\n --secondaryColor: rgba(102, 51, 153, 0.9);\\\\n}\\\\n\\\\nhtml {\\\\n overflow-x: hidden;\\\\n overflow-y: auto;\\\\n overflow: hidden auto;\\\\n}\\\\n\\\\n@media (max-width: 50rem) {\\\\n body {\\\\n color: rgba(18,52,86,0.47059);\\\\n color: var(--mainColor);\\\\n font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;\\\\n font-size: 1rem;\\\\n font-size: var(--fontSize);\\\\n line-height: calc(1rem * 1.5);\\\\n line-height: calc(var(--fontSize) * 1.5);\\\\n word-wrap: break-word;\\\\n padding-left: calc(1rem / 2 + 1px);\\\\n padding-right: calc(1rem / 2 + 1px);\\\\n padding-left: calc(var(--fontSize) / 2 + 1px);\\\\n padding-right: calc(var(--fontSize) / 2 + 1px);\\\\n }\\\\n}\\\\n\\\\nh1,h2,h3,h4,h5,h6 {\\\\n margin-top: 0;\\\\n margin-bottom: 0;\\\\n}\\\\n\\\\na {\\\\n color: rgba(0, 0, 255, 0.9)\\\\n}\\\\n\\\\na:hover {\\\\n color: #639;\\\\n }\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/basic.postcss.css\\"],\\"names\\":[],\\"mappings\\":\\"AAKA;EACE,gBAAgB;EAChB,mCAAsB;EACtB,yCAA4C;AAC9C;;AAEA;EACE,kBAAqB;EAArB,gBAAqB;EAArB,qBAAqB;AACvB;;AAEA;EACE;IACE,6BAAuB;IAAvB,uBAAuB;IACvB,iGAAsB;IACtB,eAA0B;IAA1B,0BAA0B;IAC1B,6BAAwC;IAAxC,wCAAwC;IACxC,qBAAyB;IACzB,kCAA+C;IAA/C,mCAA+C;IAA/C,6CAA+C;IAA/C,8CAA+C;EACjD;AACF;;AAEA;EACE,aAAe;EAAf,gBAAe;AACjB;;AAEA;EACE;AAKF;;AAHA;GACG,WAAoB;CACtB\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.postcss.css\\\\\\";\\\\n\\\\n@custom-media --viewport-medium (width <= 50rem);\\\\n@custom-selector :--heading h1, h2, h3, h4, h5, h6;\\\\n\\\\n:root {\\\\n --fontSize: 1rem;\\\\n --mainColor: #12345678;\\\\n --secondaryColor: lab(32.5 38.5 -47.6 / 90%);\\\\n}\\\\n\\\\nhtml {\\\\n overflow: hidden auto;\\\\n}\\\\n\\\\n@media (--viewport-medium) {\\\\n body {\\\\n color: var(--mainColor);\\\\n font-family: system-ui;\\\\n font-size: var(--fontSize);\\\\n line-height: calc(var(--fontSize) * 1.5);\\\\n overflow-wrap: break-word;\\\\n padding-inline: calc(var(--fontSize) / 2 + 1px);\\\\n }\\\\n}\\\\n\\\\n:--heading {\\\\n margin-block: 0;\\\\n}\\\\n\\\\na {\\\\n color: rgb(0 0 100% / 90%);\\\\n\\\\n&:hover {\\\\n color: rebeccapurple;\\\\n }\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
574574
// Exports
575575
export default ___CSS_LOADER_EXPORT___;
576576
"
@@ -590,7 +590,7 @@ Array [
590590
"names": Array [],
591591
"sourceRoot": "",
592592
"sources": Array [
593-
"webpack://source-map/nested/nested.postcss.css",
593+
"webpack://./source-map/nested/nested.postcss.css",
594594
],
595595
"sourcesContent": Array [
596596
".nested {
@@ -651,7 +651,7 @@ a:hover {
651651
"names": Array [],
652652
"sourceRoot": "",
653653
"sources": Array [
654-
"webpack://source-map/basic.postcss.css",
654+
"webpack://./source-map/basic.postcss.css",
655655
],
656656
"sourcesContent": Array [
657657
"@import \\"./nested/nested.postcss.css\\";
@@ -709,7 +709,7 @@ import ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \\"../../../src/runtime/cssWit
709709
import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\";
710710
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
711711
// Module
712-
___CSS_LOADER_EXPORT___.push([module.id, \\"body {\\\\n font: 100% Helvetica, sans-serif;\\\\n color: #333;\\\\n}\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/basic.scss\\"],\\"names\\":[],\\"mappings\\":\\"AAGA;EACE,gCAAA;EACA,WAJc;AAEhB\\",\\"sourcesContent\\":[\\"$font-stack: Helvetica, sans-serif;\\\\n$primary-color: #333;\\\\n\\\\nbody {\\\\n font: 100% $font-stack;\\\\n color: $primary-color;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
712+
___CSS_LOADER_EXPORT___.push([module.id, \\"body {\\\\n font: 100% Helvetica, sans-serif;\\\\n color: #333;\\\\n}\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/basic.scss\\"],\\"names\\":[],\\"mappings\\":\\"AAGA;EACE,gCAAA;EACA,WAJc;AAEhB\\",\\"sourcesContent\\":[\\"$font-stack: Helvetica, sans-serif;\\\\n$primary-color: #333;\\\\n\\\\nbody {\\\\n font: 100% $font-stack;\\\\n color: $primary-color;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
713713
// Exports
714714
export default ___CSS_LOADER_EXPORT___;
715715
"
@@ -729,7 +729,7 @@ Array [
729729
"names": Array [],
730730
"sourceRoot": "",
731731
"sources": Array [
732-
"webpack://source-map/basic.scss",
732+
"webpack://./source-map/basic.scss",
733733
],
734734
"sourcesContent": Array [
735735
"$font-stack: Helvetica, sans-serif;
@@ -757,7 +757,7 @@ import ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \\"../../../src/runtime/cssWit
757757
import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\";
758758
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
759759
// Module
760-
___CSS_LOADER_EXPORT___.push([module.id, \\"body {\\\\n font: 14px/1.5 Helvetica, arial, sans-serif;\\\\n}\\\\nbody #logo {\\\\n border-radius: 5px;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/base.styl\\"],\\"names\\":[],\\"mappings\\":\\"AAAA;EACE,2CAAwB;AAC1B;AAAE;EACE,kBAAe;AAEnB\\",\\"sourcesContent\\":[\\"body {\\\\n font: 14px/1.5 Helvetica, arial, sans-serif;\\\\n #logo {\\\\n border-radius: 5px;\\\\n }\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
760+
___CSS_LOADER_EXPORT___.push([module.id, \\"body {\\\\n font: 14px/1.5 Helvetica, arial, sans-serif;\\\\n}\\\\nbody #logo {\\\\n border-radius: 5px;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/base.styl\\"],\\"names\\":[],\\"mappings\\":\\"AAAA;EACE,2CAAwB;AAC1B;AAAE;EACE,kBAAe;AAEnB\\",\\"sourcesContent\\":[\\"body {\\\\n font: 14px/1.5 Helvetica, arial, sans-serif;\\\\n #logo {\\\\n border-radius: 5px;\\\\n }\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
761761
// Exports
762762
export default ___CSS_LOADER_EXPORT___;
763763
"
@@ -780,7 +780,7 @@ body #logo {
780780
"names": Array [],
781781
"sourceRoot": "",
782782
"sources": Array [
783-
"webpack://source-map/base.styl",
783+
"webpack://./source-map/base.styl",
784784
],
785785
"sourcesContent": Array [
786786
"body {
@@ -809,7 +809,7 @@ import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??[ident
809809
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
810810
___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);
811811
// Module
812-
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
812+
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
813813
// Exports
814814
export default ___CSS_LOADER_EXPORT___;
815815
"
@@ -829,7 +829,7 @@ Array [
829829
"names": Array [],
830830
"sourceRoot": "",
831831
"sources": Array [
832-
"webpack://source-map/nested/nested.css",
832+
"webpack://./source-map/nested/nested.css",
833833
],
834834
"sourcesContent": Array [
835835
".nested {
@@ -852,7 +852,7 @@ Array [
852852
"names": Array [],
853853
"sourceRoot": "",
854854
"sources": Array [
855-
"webpack://source-map/basic.css",
855+
"webpack://./source-map/basic.css",
856856
],
857857
"sourcesContent": Array [
858858
"@import \\"./nested/nested.css\\";
@@ -880,7 +880,7 @@ import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??[ident
880880
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
881881
___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);
882882
// Module
883-
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
883+
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
884884
// Exports
885885
export default ___CSS_LOADER_EXPORT___;
886886
"
@@ -900,7 +900,7 @@ Array [
900900
"names": Array [],
901901
"sourceRoot": "",
902902
"sources": Array [
903-
"webpack://source-map/nested/nested.css",
903+
"webpack://./source-map/nested/nested.css",
904904
],
905905
"sourcesContent": Array [
906906
".nested {
@@ -923,7 +923,7 @@ Array [
923923
"names": Array [],
924924
"sourceRoot": "",
925925
"sources": Array [
926-
"webpack://source-map/basic.css",
926+
"webpack://./source-map/basic.css",
927927
],
928928
"sourcesContent": Array [
929929
"@import \\"./nested/nested.css\\";
@@ -951,7 +951,7 @@ import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??[ident
951951
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
952952
___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);
953953
// Module
954-
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
954+
___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n color: red;\\\\n}\\\\n\\", \\"\\",{\\"version\\":3,\\"sources\\":[\\"webpack://./source-map/basic.css\\"],\\"names\\":[],\\"mappings\\":\\"AAEA;EACE,UAAU;AACZ\\",\\"sourcesContent\\":[\\"@import \\\\\\"./nested/nested.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}]);
955955
// Exports
956956
export default ___CSS_LOADER_EXPORT___;
957957
"
@@ -971,7 +971,7 @@ Array [
971971
"names": Array [],
972972
"sourceRoot": "",
973973
"sources": Array [
974-
"webpack://source-map/nested/nested.css",
974+
"webpack://./source-map/nested/nested.css",
975975
],
976976
"sourcesContent": Array [
977977
".nested {
@@ -994,7 +994,7 @@ Array [
994994
"names": Array [],
995995
"sourceRoot": "",
996996
"sources": Array [
997-
"webpack://source-map/basic.css",
997+
"webpack://./source-map/basic.css",
998998
],
999999
"sourcesContent": Array [
10001000
"@import \\"./nested/nested.css\\";

‎test/sourceMap-option.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ describe('"sourceMap" option', () => {
609609

610610
expect(chunkName).toBe(
611611
// TODO still buggy on webpack@4
612-
webpack.version[0] === '5' ? 'main.208dafd9be3442f7a927.css' : chunkName
612+
webpack.version[0] === '5' ? 'main.0c4134a13ce273487b87.css' : chunkName
613613
);
614614

615615
expect(

0 commit comments

Comments
 (0)
Please sign in to comment.