Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Source map not generated through API #605

Closed
jescalan opened this issue Jan 6, 2015 · 3 comments
Closed

Source map not generated through API #605

jescalan opened this issue Jan 6, 2015 · 3 comments

Comments

@jescalan
Copy link
Contributor

jescalan commented Jan 6, 2015

I feel like this one is either something dumb I'm missing or something quick you guys can fix. I see that you have a test for source map generation through the CLI, but not through the API. And when I try to generate one through the API, it's coming up blank.

Reproduce:

sass.render({
  sourceMap: true,
  data: "stylesheet blah blah",
  success: function(res){ console.log(res.map) }
});

This logs out {}, unfortunately.

@am11
Copy link
Contributor

am11 commented Jan 6, 2015

Possible duplicate #591.

You need to set outFile and file option to make the maps generated (with v2.0.0, you will only require to set outFile option in case of data).

@jescalan
Copy link
Contributor Author

jescalan commented Jan 6, 2015

Just got this and came back here to comment but you were too quick! I feel like it should be made clear under the sourceMap option documentation that this option requires 2 other options to be set or it will do nothing. It seems like the guy who filed 591 said he would PR clarity in the docs, did he never do this? I can do it now if not, only takes a minute.

@am11
Copy link
Contributor

am11 commented Jan 6, 2015

In case of data, we need to set outFile option as well so to make sourceMap option take effect.
This is how it will be with forthcoming v2.0.0 (for which I am building binary right now).
Sure thing, PRs are always welcome! :)

Sorry for the haste, I thought the solution addresses this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants