question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding comments header for compiled & optimized files

See original GitHub issue

Adding a plain text to the header of a compiled and optimized .js-file may be useful for multiple reasons:

  • Adding metadata like version, compiler settings, date, …
  • Adding execution information, e.g. #!/usr/bin/env node
  • Adding a License, Author, Support info, URL, …

Such a plain text header could easily be added to a .js in a postprocessing step after compilation. However, if I am not mistaken, the Sourcemap would also have to be remapped. That seems to me like a quite involved chore.

This brings me to the following feature request: Would it be possible to add a “headerString” option to the SBT plugin, such that such a header can be added more easily?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sjrdcommented, Sep 18, 2020

I would much rather insert actual JS comments (their grammar isn’t that hard to check, to make sure that no one is inserting anything but comments). That way reasonable use cases are addressed at the core.

And if someone really wants the shebang thing, they can insert a one-line comment, then do the patching.

1reaction
DirkToewecommented, Feb 18, 2019

Comments alone would already be very helpful to me. The #!/usr/bin/env node shebang may be useful to others but I don’t have a use case for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you add a header comment to files compiled by gulp
I have a ASP .NET Core 3.1 project that is using gulp to compile a number of SCSS files and JS files. Is...
Read more >
Precompiled Header Files | Microsoft Learn
The compiler options for precompiled headers are /Y . In the project property pages, the options are located under Configuration Properties > C/ ......
Read more >
Optimizing Header File Include Directives
KEY WORDS: C, C++, header files, include directive, preprocessor ... conditional compilation, comment removal, and file inclusion [3, §3.8].
Read more >
Optimizing Header File Include Directives - CiteSeerX
KEY WORDS: C, C++, header files, include directive, preprocessor ... conditional compilation, comment removal, and file inclusion [3, §3.8].
Read more >
Top 10 C++ header file mistakes and how to fix them
1. Try to avoid putting any using namespace declarations in your header files. If you absolutely need some namespace objects to get your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found