Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Preserve trailing newline in mangle.json #497
Comments
<!doctype html> <script defer> // modernBuild = Modules + Dynamic Import support import('./dist/test.js'); window.modernBuild = true; </script> <script defer> if (!window.modernBuild) { document.head.appendChild(Object.assign(document.createElement('script'), { src: './jspm_packages/npm/systemjs@5.0.0/dist/s.min.js', onload: function () { System.import('./dist-system/test.js'); } })); } </script> |
Currently,
mangle.json
writes always remove a trailing newline from the file. We could detect the existence of the trailing newline when reading, then preserve whatever was used when writing.See https://github.com/preactjs/preact/blob/e22cc99ca398bb0a417ccc151a520c41215afe55/.editorconfig#L17-L22