Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Mar 9, 2025
1 parent 9ca03f6 commit 29b86c6
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions scripts/verify-source-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,18 +573,24 @@ const toSearchNestedFoldersIssue4070 = {
'bar': 'src/app/app.config.js',
}

// Windows paths make this complicated...
const rootDir = path.dirname(process.cwd().split(path.sep).slice(0, 2).join(path.sep))
const path4075 = path.join(rootDir, 'out', 'src', 'styles')
const url4075 = url.pathToFileURL(path4075)
const url4075Encoded = encodeURIComponent(JSON.stringify(url4075 + '1.scss').slice(1, -1))
const path4075Encoded = encodeURIComponent(JSON.stringify(path4075 + '2.scss').slice(1, -1))
const testCaseAbsolutePathIssue4075 = {
'entry.css': `
@import "./styles.css";
@import "./styles1.css";
@import "./styles2.css";
`,
'styles.css': `/* You can add global styles to this file, and also import other style files */
'styles1.css': `/* You can add global styles to this file, and also import other style files */
* {
content: "foo";
}
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,` +
`%22sourceRoot%22:%22%22,%22sources%22:%5B%22file:///out/src/styles.scss` +
`%22sourceRoot%22:%22%22,%22sources%22:%5B%22${url4075Encoded}` +
`%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAAA;AACA;EACE,SAAS%22,%22f` +
`ile%22:%22out%22,%22sourcesContent%22:%5B%22/*%20You%20can%20add%20glob` +
`al%20styles%20to%20this%20file,%20and%20also%20import%20other%20style%2` +
Expand All @@ -596,18 +602,18 @@ const testCaseAbsolutePathIssue4075 = {
}
/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,` +
`%22sourceRoot%22:%22%22,%22sources%22:%5B%22/out/src/styles2.scss%22%5D` +
`,%22names%22:%5B%5D,%22mappings%22:%22AAAA;AACA;EACE,SAAS%22,%22file%22` +
`:%22out%22,%22sourcesContent%22:%5B%22/*%20You%20can%20add%20global%20s` +
`tyles%20to%20this%20file,%20and%20also%20import%20other%20style%20files` +
`%20%2A/%5Cn*%20%7B%5Cn%20%20content:%20%5C%22bar%5C%22%5Cn%7D%5Cn%22%5D` +
`%7D */
`%22sourceRoot%22:%22%22,%22sources%22:%5B%22${path4075Encoded}` +
`%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAAA;AACA;EACE,SAAS%22,%22f` +
`ile%22:%22out%22,%22sourcesContent%22:%5B%22/*%20You%20can%20add%20glob` +
`al%20styles%20to%20this%20file,%20and%20also%20import%20other%20style%2` +
`0files%20%2A/%5Cn*%20%7B%5Cn%20%20content:%20%5C%22bar%5C%22%5Cn%7D%5Cn` +
`%22%5D%7D */
`,
}

const toSearchAbsolutePathIssue4075 = {
foo: path.relative(path.join(testDir, '(this test)'), '/out/src/styles.scss'),
bar: path.relative(path.join(testDir, '(this test)'), '/out/src/styles2.scss'),
foo: path.relative(path.join(testDir, '(this test)'), path4075 + '1.scss'),
bar: path.relative(path.join(testDir, '(this test)'), path4075 + '2.scss'),
}

const testCaseMissingSourcesIssue4104 = {
Expand Down

0 comments on commit 29b86c6

Please sign in to comment.