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

Set the sourceMap path if the sourceComment was 'map' #245

Closed
sindresorhus opened this issue Feb 23, 2014 · 5 comments
Closed

Set the sourceMap path if the sourceComment was 'map' #245

sindresorhus opened this issue Feb 23, 2014 · 5 comments

Comments

@sindresorhus
Copy link
Contributor

See https://github.com/sindresorhus/grunt-sass/pull/61/files#diff-27568616eb678531b1ccb957e1b8aaebR17

The logic should be moved from the bin to node-sass so every consumer doesn't have to reimplement that logic.

@adamyeats-zz
Copy link

This looks to be slightly more problematic than I first thought. As sass.js does not receive an outFile path (instead we leave it up to the consumer to decide where and how to write the outFile), there is currently no way we can know where the sourcemap should be written without explicitly passing the outFile path to sass.render().

@andrew @sindresorhus If the condition options.sourceComments === 'map' && !options.sourceMap is true, I am proposing we just throw. Does anyone have any thoughts on this?

@andrew
Copy link
Contributor

andrew commented Mar 24, 2014

Yeah it doesn't look like this going to work, not really sure how to proceed tbh.

@adamyeats-zz
Copy link

@andrew In the interest of getting the issue solved, my opinion is that we should throw. I would like to hear @sindresorhus' opinion, however.

@sindresorhus
Copy link
Contributor Author

Yup, throw with an helpful error message on how to resolve it.

@am11
Copy link
Contributor

am11 commented Oct 22, 2014

A lot has been changed since.

  • OutFile is now passed to libsass (so it can calculate correct URLs in source maps).
  • Libsass is using C99 bool for sourceComments (no more int).
  • The semantics have been changed:
    • sourceComment: map would generate map file with sourceMapURL in CSS file.
    • sourceComment: map with omitSourceMapUrl: true will drop the sourceMapURL would generate map file with sourceMapURL in CSS file.
    • sourceComment: normal will generate inline comments in CSS,
    • souceComment: normal and sourceMap: <abs-or-rel-path-to-file> would generate both source-map file and inline comment.

@am11 am11 closed this as completed Oct 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants