Skip to content

Commit

Permalink
fix line endings for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Oct 22, 2020
1 parent 247cfa6 commit 98b70d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/summarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = function summarize(summaryPath) {
if (isUglifyable) {
return uglify(concatenatedContent);
} else {
return concatenatedContent;
return normalizeLineEndings(concatenatedContent);
}
})
.then(content => {
Expand All @@ -84,7 +84,7 @@ module.exports = function summarize(summaryPath) {
})
.then(({ compressedSize, baseSize }) => {
return Promise.all(fileNames.map(relativePath => {
let content = fileContents[relativePath].replace(/(\r\n|\n|\r)/gm, "\n");
let content = normalizeLineEndings(fileContents[relativePath]);

return Promise.resolve()
.then(() => {
Expand Down
4 changes: 2 additions & 2 deletions test/acceptance/__snapshots__/cli.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ exports[`CLI generates expected output 3`] = `
\\"relativePath\\": \\"vendor/qunit/qunit.css\\",
\\"sizes\\": {
\\"raw\\": 7875,
\\"compressed\\": 2033.8582677165355
\\"compressed\\": 2123.0700712589073
}
},
{
\\"relativePath\\": \\"vendor/ember-qunit/test-container-styles.css\\",
\\"sizes\\": {
\\"raw\\": 544,
\\"compressed\\": 140.4976377952756
\\"compressed\\": 146.6603325415677
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions test/integration/__snapshots__/summarize.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ exports[`summarize summarize-all calculates sizes of all files 3`] = `
\\"relativePath\\": \\"vendor/qunit/qunit.css\\",
\\"sizes\\": {
\\"raw\\": 7875,
\\"compressed\\": 2033.8582677165355
\\"compressed\\": 2123.0700712589073
}
},
{
\\"relativePath\\": \\"vendor/ember-qunit/test-container-styles.css\\",
\\"sizes\\": {
\\"raw\\": 544,
\\"compressed\\": 140.4976377952756
\\"compressed\\": 146.6603325415677
}
}
]
Expand Down

0 comments on commit 98b70d1

Please sign in to comment.