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

Inline sourceMaps #810

Closed
make-github-pseudonymous-again opened this issue Feb 26, 2021 · 5 comments
Closed

Inline sourceMaps #810

make-github-pseudonymous-again opened this issue Feb 26, 2021 · 5 comments

Comments

@make-github-pseudonymous-again

I have babel configured with inline sourceMaps using "sourceMaps": "inline". It works when I use babel instead of microbundle.
You can see the config here: https://github.com/aureooms/set-alarm/blob/9f7f4900073af814016bed15fdea4cb90b0bb051/package.json#L33
Microbundle seems to ignore this choice. Is this a bug? Feature? Is there a case against inline source maps?

@developit
Copy link
Owner

Inline sourcemaps are generally not recommended because they increase bundle size and parse times. Some configurations remove them, but not all.

FWIW Microbundle isn't ignoring the babel config, it's using Rollup to produce bundles. Changing the babel config only changes the code string passed to Rollup, not the output.

We don't currently support inline sourcemaps because they are typically misused and a footgun. Do you have a compelling case that requires it?

@make-github-pseudonymous-again
Copy link
Author

make-github-pseudonymous-again commented Feb 26, 2021

Do you have a compelling case that requires it?

None. I am holding on some old habits. I am open to change my behavior. I am curious because I thought having the source map inline simplifies development tools. I had overlooked the parsing time issue. And that alone should be enough not to use the maps inline. Even though these get stripped in production.

I imagine you also gain in development performance when you only load these maps when required. Not only parsing but also transfer time. Although in my case it happens locally so I do not care.

I think it is good that you do not support inline source maps. It prevented me from perpetuating a bad habit.

@make-github-pseudonymous-again
Copy link
Author

make-github-pseudonymous-again commented Mar 31, 2021

Now I do remember why I had stuck with inline sourcemaps. It seems to be the only way to get accurate coverage reports with nyc/c8 and AVA. Not a problem since I can have a custom BABEL_ENV for that use case.

@wardpeet
Copy link
Collaborator

wardpeet commented May 8, 2021

Thank you for opening this, @make-github-pseudonymous-again

We're marking this issue as answered and closing it for now but please feel free to reopen this and comment if you would like to continue this discussion. We hope we managed to help and thank you for using Microbundle!

@wardpeet wardpeet closed this as completed May 8, 2021
@Clemens-E
Copy link

The only compelling reason is using it during development, inline source maps make it a lot easier if the rest of the application isn't designed to handle sourcemaps.

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

No branches or pull requests

4 participants