Skip to content

Commit

Permalink
fix: avoid id inconsitency caused by CRLF
Browse files Browse the repository at this point in the history
See #1706
  • Loading branch information
sodatea committed Oct 26, 2020
1 parent 2e98ea6 commit 4b9b26c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Expand Up @@ -116,7 +116,11 @@ export default function loader(
.relative(rootContext || process.cwd(), resourcePath)
.replace(/^(\.\.[\/\\])+/, '')
const shortFilePath = rawShortFilePath.replace(/\\/g, '/') + resourceQuery
const id = hash(isProduction ? shortFilePath + '\n' + source : shortFilePath)
const id = hash(
isProduction
? shortFilePath + '\n' + source.replace(/\r\n/g, '\n')
: shortFilePath
)

// feature information
const hasScoped = descriptor.styles.some((s) => s.scoped)
Expand Down

0 comments on commit 4b9b26c

Please sign in to comment.