Skip to content

Conversation

@lydell
Copy link
Collaborator

@lydell lydell commented Mar 6, 2016

  • Inline source maps are now shorter by not using pretty-printed JSON.
  • .register()ed files are now given more information in their inline source
    maps: The name and contents of the source file.
  • Some code cleanup.

If you decode the inline source map generated (when using .register()) for a
file test.coffee with the contents console.log "it works!", here is the
output:

Before:

{
  "version": 3,
  "file": "",
  "sourceRoot": "",
  "sources": [
    ""
  ],
  "names": [],
  "mappings": "AAAA;EAAA,OAAO,CAAC,GAAR,CAAY,eAAZ;AAAA"
}

After:

{"version":3,"file":"","sourceRoot":"","sources":["test.coffee"],"names":[],"mappings":"AAAA;EAAA,OAAO,CAAC,GAAR,CAAY,WAAZ;AAAA","sourcesContent":["console.log \"it works!\"\n"]}

Related: #4214.

- Inline source maps are now shorter by not using pretty-printed JSON.
- `.register()`ed files are now given more information in their inline source
  maps: The name and contents of the source file.
- Some code cleanup.

If you decode the inline source map generated (when using `.register()`) for a
file test.coffee with the contents `console.log "it works!"`, here is the
output:

Before:

    {
      "version": 3,
      "file": "",
      "sourceRoot": "",
      "sources": [
        ""
      ],
      "names": [],
      "mappings": "AAAA;EAAA,OAAO,CAAC,GAAR,CAAY,eAAZ;AAAA"
    }

After:

    {"version":3,"file":"","sourceRoot":"","sources":["test.coffee"],"names":[],"mappings":"AAAA;EAAA,OAAO,CAAC,GAAR,CAAY,WAAZ;AAAA","sourcesContent":["console.log \"it works!\"\n"]}

Related: jashkenas#4214.
michaelficarra added a commit that referenced this pull request Mar 6, 2016
Improve inline source maps generation
@michaelficarra michaelficarra merged commit 6291b53 into jashkenas:master Mar 6, 2016
@lydell lydell deleted the inline-maps branch March 6, 2016 15:34
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 this pull request may close these issues.

2 participants