Skip to content

Commit 29b86c6

Browse files
committed
wip
1 parent 9ca03f6 commit 29b86c6

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

scripts/verify-source-map.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -573,18 +573,24 @@ const toSearchNestedFoldersIssue4070 = {
573573
'bar': 'src/app/app.config.js',
574574
}
575575

576+
// Windows paths make this complicated...
577+
const rootDir = path.dirname(process.cwd().split(path.sep).slice(0, 2).join(path.sep))
578+
const path4075 = path.join(rootDir, 'out', 'src', 'styles')
579+
const url4075 = url.pathToFileURL(path4075)
580+
const url4075Encoded = encodeURIComponent(JSON.stringify(url4075 + '1.scss').slice(1, -1))
581+
const path4075Encoded = encodeURIComponent(JSON.stringify(path4075 + '2.scss').slice(1, -1))
576582
const testCaseAbsolutePathIssue4075 = {
577583
'entry.css': `
578-
@import "./styles.css";
584+
@import "./styles1.css";
579585
@import "./styles2.css";
580586
`,
581-
'styles.css': `/* You can add global styles to this file, and also import other style files */
587+
'styles1.css': `/* You can add global styles to this file, and also import other style files */
582588
* {
583589
content: "foo";
584590
}
585591
586592
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,` +
587-
`%22sourceRoot%22:%22%22,%22sources%22:%5B%22file:///out/src/styles.scss` +
593+
`%22sourceRoot%22:%22%22,%22sources%22:%5B%22${url4075Encoded}` +
588594
`%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAAA;AACA;EACE,SAAS%22,%22f` +
589595
`ile%22:%22out%22,%22sourcesContent%22:%5B%22/*%20You%20can%20add%20glob` +
590596
`al%20styles%20to%20this%20file,%20and%20also%20import%20other%20style%2` +
@@ -596,18 +602,18 @@ const testCaseAbsolutePathIssue4075 = {
596602
}
597603
598604
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,` +
599-
`%22sourceRoot%22:%22%22,%22sources%22:%5B%22/out/src/styles2.scss%22%5D` +
600-
`,%22names%22:%5B%5D,%22mappings%22:%22AAAA;AACA;EACE,SAAS%22,%22file%22` +
601-
`:%22out%22,%22sourcesContent%22:%5B%22/*%20You%20can%20add%20global%20s` +
602-
`tyles%20to%20this%20file,%20and%20also%20import%20other%20style%20files` +
603-
`%20%2A/%5Cn*%20%7B%5Cn%20%20content:%20%5C%22bar%5C%22%5Cn%7D%5Cn%22%5D` +
604-
`%7D */
605+
`%22sourceRoot%22:%22%22,%22sources%22:%5B%22${path4075Encoded}` +
606+
`%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAAA;AACA;EACE,SAAS%22,%22f` +
607+
`ile%22:%22out%22,%22sourcesContent%22:%5B%22/*%20You%20can%20add%20glob` +
608+
`al%20styles%20to%20this%20file,%20and%20also%20import%20other%20style%2` +
609+
`0files%20%2A/%5Cn*%20%7B%5Cn%20%20content:%20%5C%22bar%5C%22%5Cn%7D%5Cn` +
610+
`%22%5D%7D */
605611
`,
606612
}
607613

608614
const toSearchAbsolutePathIssue4075 = {
609-
foo: path.relative(path.join(testDir, '(this test)'), '/out/src/styles.scss'),
610-
bar: path.relative(path.join(testDir, '(this test)'), '/out/src/styles2.scss'),
615+
foo: path.relative(path.join(testDir, '(this test)'), path4075 + '1.scss'),
616+
bar: path.relative(path.join(testDir, '(this test)'), path4075 + '2.scss'),
611617
}
612618

613619
const testCaseMissingSourcesIssue4104 = {

0 commit comments

Comments
 (0)