Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundled output has mixed line-endings #17

Open
tmillr opened this issue Nov 30, 2022 · 0 comments · May be fixed by #24
Open

Bundled output has mixed line-endings #17

tmillr opened this issue Nov 30, 2022 · 0 comments · May be fixed by #24

Comments

@tmillr
Copy link
Owner

tmillr commented Nov 30, 2022

It's probably not a huge issue (integration or end-to-end tests should determine if it is) as we're not publishing a library (whose code could be further used/bundled downstream). I heard that it might cause an issue on Nodejs on Linux however.

Ideas For Fix

Either don't bundle (which is what creates the mixed line-endings), or use a tool post-bundle to convert all line-endings to LF. One idea is to use Terser, which will also potentially minify, as well and provide a final source map (useful for coverage reports). Terser will parse into AST and then emit all LF line-endings. Parsing into AST instead of blindly replacing all CRLF with LF is better as it is possible (I think) for there to be CRLF in positions other than source code line endings (e.g. maybe a string literal could contain one).

@tmillr tmillr linked a pull request Dec 17, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant