Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Savara <pavelsavara@microsoft.com>2021-12-06 12:34:16 +0300
committerGitHub <noreply@github.com>2021-12-06 12:34:16 +0300
commit8929153f16c841cfd6269f511d4c0b65ba5d1965 (patch)
tree1b99f028d1a02311546b426e42f57db76df76f2e
parentfedf64f5688246b73505537c4dd81fc0afb57ddb (diff)
force versioned dotnet.d.ts to always have unix style end of line (#62418)
-rw-r--r--.gitattributes1
-rw-r--r--src/mono/wasm/runtime/rollup.config.js15
2 files changed, 15 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes
index b4e3bcd0745..a25b1f94d6e 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -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
diff --git a/src/mono/wasm/runtime/rollup.config.js b/src/mono/wasm/runtime/rollup.config.js
index b9266366507..6f4b8b06d95 100644
--- a/src/mono/wasm/runtime/rollup.config.js
+++ b/src/mono/wasm/runtime/rollup.config.js
@@ -86,7 +86,7 @@ if (isDebug) {
format: "es",
file: "./dotnet.d.ts",
banner: banner_generated,
- plugins: [writeOnChangePlugin()],
+ plugins: [alwaysLF(), writeOnChangePlugin()],
});
}
@@ -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];