diff options
author | Pavel Savara <pavelsavara@microsoft.com> | 2021-12-06 12:34:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-06 12:34:16 +0300 |
commit | 8929153f16c841cfd6269f511d4c0b65ba5d1965 (patch) | |
tree | 1b99f028d1a02311546b426e42f57db76df76f2e /src/mono/wasm/runtime | |
parent | fedf64f5688246b73505537c4dd81fc0afb57ddb (diff) |
force versioned dotnet.d.ts to always have unix style end of line (#62418)
Diffstat (limited to 'src/mono/wasm/runtime')
-rw-r--r-- | src/mono/wasm/runtime/rollup.config.js | 15 |
1 files changed, 14 insertions, 1 deletions
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]; |