Skip to content

Commit

Permalink
force versioned dotnet.d.ts to always have unix style end of line (#6…
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara committed Dec 6, 2021
1 parent fedf64f commit 8929153
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Expand Up @@ -75,3 +75,4 @@ src/tests/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/revcomp-
src/tests/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/revcomp-input25000.txt text eol=lf
src/tests/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input.txt text eol=lf
src/tests/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input-big.txt text eol=lf
src/mono/wasm/runtime/dotnet.d.ts text eol=lf
15 changes: 14 additions & 1 deletion src/mono/wasm/runtime/rollup.config.js
Expand Up @@ -86,7 +86,7 @@ if (isDebug) {
format: "es",
file: "./dotnet.d.ts",
banner: banner_generated,
plugins: [writeOnChangePlugin()],
plugins: [alwaysLF(), writeOnChangePlugin()],
});
}

Expand All @@ -103,6 +103,19 @@ function writeOnChangePlugin() {
};
}

// force always unix line ending
function alwaysLF() {
return {
name: "writeOnChange",
generateBundle: (options, bundle) => {
const name = Object.keys(bundle)[0];
const asset = bundle[name];
const code = asset.code;
asset.code = code.replace(/\r/g, "");
}
};
}

async function writeWhenChanged(options, bundle) {
try {
const name = Object.keys(bundle)[0];
Expand Down

0 comments on commit 8929153

Please sign in to comment.