Skip to content

Add more cli opts and source map config args #279

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
Dec 17, 2018

Conversation

fdintino
Copy link
Contributor

@fdintino fdintino commented Dec 8, 2018

I had the need to be able to emit source maps using libsass-python that contain sourcesContent. When I set out to make a PR to add this functionality I realized that there are quite a few libsass options not exposed through the API, and also that the cli script does not allow setting all of the options that are already exposed. With these PR, the library and cli script are brought into feature parity with other libsass bindings, such as node-sass.

Newly added kwargs include:

  • source_map_contents: Emits sourcesContent property in source map (fixes Support embedding sources' contents #268)
  • source_map_embed: Embeds sourcemap as a data uri in sourceMappingURL comment
  • omit_source_map_url: Omits the source map comment from the css output file
  • source_map_root: Sets the sourceRoot property in a source map

All of these are exposed via the cli using the existing naming conventions, i.e. source_map_contents can be enabled with --sourcemap-contents.

Newly added cli flags that map onto already exposed libsass options:

  • -i / --indented-syntax: enables sass (not scss) parsing
  • --sourcemap-file: Allows overriding of source_map_filename via the cli

@fdintino fdintino force-pushed the add-source-map-args-cli-opts branch 4 times, most recently from ec00f07 to 560ebbb Compare December 8, 2018 22:15
@asottile
Copy link
Member

asottile commented Dec 9, 2018

whoa this is great, there's a lot for me to read through so it might take me a bit to get to it all but this is incredible!

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

a few little things! overall looks good

@fdintino fdintino force-pushed the add-source-map-args-cli-opts branch from 560ebbb to 734d4ab Compare December 17, 2018 21:05
@fdintino
Copy link
Contributor Author

I've incorporated the feedback in the latest commit. Let me know if I missed something.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

@asottile asottile merged commit f3d7571 into sass:master Dec 17, 2018
@asottile
Copy link
Member

thanks for this awesome change! I'll try it out and then hopefully get a release soon

@asottile
Copy link
Member

asottile commented Jan 2, 2019

so sorry, I totally forgot about this -- looking at getting #280 in and making a release

@asottile
Copy link
Member

asottile commented Jan 4, 2019

this has been released in 0.17.0 🎉 -- thanks again!

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.

Support embedding sources' contents
2 participants