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

Source files json in pretty format with line breaks #374

Open
donquixote opened this issue Dec 4, 2019 · 1 comment
Open

Source files json in pretty format with line breaks #374

donquixote opened this issue Dec 4, 2019 · 1 comment

Comments

@donquixote
Copy link

See also #176. I cannot reopen that, so I am creating a new one with a (hopefully) more clear description.

Source maps are generated in an "ugly" json format, without line breaks or indentation. Very much like a minified CSS file.

This may be good enough for most cases, but there are some situations where a pretty format would be more useful:

  • If the source map is checked into a git repository. git diff, merge etc works much better if the code is broken into multiple lines.
  • If a developer is actively looking at the source map code.

Usually the main benefit of a non-formatted file is performance, by slightly reducing the file size.
This is not really relevant here, because the file will only be downloaded if someone opens the browser developer tools.

Current format:

{"version":3,"sources":["overrides.css","overrides/_forms.scss","overrides.scss","variables/_typography.scss", [..]

Pretty:

{
  "version": 3,
  "sources": [
    "overrides.css",
    "overrides/_forms.scss",
    "overrides.scss",
    "variables/_typography.scss",
[..]

This should be optional, so that existing code does not change unexpectedly from downloading a new version of gulp-sourcemaps.

@raptor235

This comment has been minimized.

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

2 participants