Skip to content

Embed source file content in source map #33

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

Merged
merged 1 commit into from
May 28, 2014
Merged

Conversation

conradz
Copy link
Contributor

@conradz conradz commented May 23, 2014

Depends on latest (currently unreleased) css-parse git master.

This adds the source file contents to the source map, like browserify and most other bundling tools do. Browser dev tools no longer have to access the original source files over HTTP, they can just pull them out of the source map.

Depends on latest css-stringify git master
necolas added a commit that referenced this pull request May 28, 2014
Embed source file content in source map
@necolas necolas merged commit b040eb0 into master May 28, 2014
@MoOx MoOx deleted the embed-source-content branch May 28, 2014 18:36
@@ -62,13 +64,15 @@ exports.emit = function(str, pos, startOnly) {
column: pos.start.column - 1
}
});

this.map.setSourceContent(sourceFile, pos.content || '');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t it better to:

if (pos.content) {
  this.map.setSourceContent(sourceFile, pos.content);
}

There’s nothing wrong with setting source content just for a few sources. The rest could be fetched by a browser’s developer tools, for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 87d6994

conradz added a commit that referenced this pull request Jun 2, 2014
Somehow these had been added in #33 but lost in a later merge.
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.

3 participants