Skip to content
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

Add input AST with SourceMap attribution support #33

Open
dotherightthing opened this issue May 28, 2014 · 11 comments
Open

Add input AST with SourceMap attribution support #33

dotherightthing opened this issue May 28, 2014 · 11 comments

Comments

@dotherightthing
Copy link

I'm running grunt-bless on my CSS after it has been run through grunt-contrib-compass.

grunt-bless is a wrapper for bless.js, while grunt-contrib-compass is a wrapper for Compass.

When grunt-contrib-compass is run with the latest version of Compass (1.0.0.alpha.19), with:

"options": {
    "sourcemap": true
}

.. a sourcemap is generated for each CSS file that is generated:

print.css
print.css.map
screen.css
screen.css.map

The .map file can be read by browsers like Google Chrome, to trace styles back to the original Sass file.

This works fine - up until the point when grunt-bless is run on the Compass output. Now we have:

print.css
print.css.map
screen.css
screen.css.map
screen.blessed.css

There are three problems here:

  1. screen.blessed.css.map should be generated
  2. screen.blessed.css.map should contain the pointer "file": "screen.blessed.css" (rather that "file": "screen.css")
  3. screen.blessed.css should contain the pointer /*# sourceMappingURL=screen.blessed.css.map */

Thanks!

@paulyoung
Copy link
Contributor

Thanks. 4.0 is coming up and is the best candidate for this.

@booleanbetrayal
Copy link

I imagine this is a rather annoying feature for implementation, but I can vouch for its importance as we move to a proper piping workflow.

@mevbg
Copy link

mevbg commented Feb 24, 2015

Hey Paul,

Do you have any news about how version 4.0 of bless.js is going on?

I also have the issue with the stripped comment for my source maps.

Martin

@paulyoung
Copy link
Contributor

Hi @martinmethod!

I just changed jobs 💻, moved 🏠, and had another baby 👶, so things have been on hold for a while.

Planning on giving this some attention soon so that it can be in a better place to accept contributions.

@adam-lynch
Copy link
Member

👍 BlessCSS/gulp-bless#14

For me it would be best if bless returned the computed sourcemap programmatically. If I have the following code (using version 3 just for this example FYI):

new (bless.Parser)({
    output: outputFilePath,
    options: blessOpts
}).parse(contents, function(err, blessedFiles, numSelectors) {          

Then each blessedFiles should have a map / sourcemap property as well as content, etc. This would allow for gulp sourcemap support.

@paulyoung
Copy link
Contributor

I think this issue can now be closed since sourcemaps were added as part of #63.

@mtscout6
Copy link
Member

Agreed!

@inukshuk
Copy link

Just a quick question, it looks like it isn't possible to pass-in source maps, is that correct? In other words, if I already generate source maps in node sass, modify them in autoprefixer and then want to run bless on the result -- this is a scenario that is not supported yet, or is it? Thanks a lot for your work!

@mtscout6
Copy link
Member

@inukshuk You're right, though it wouldn't take much to change it to do so. We parse out the AST at https://github.com/BlessCSS/bless/blob/master/src/chunk.js#L40. Basically we just need to decouple the AST parsing from the chunking which is a move in the right direction. I'm too busy to tackle it this week, but would be open to a pull request that addresses it.

I'll re-open this issue and change the title to reflect this.

@mtscout6 mtscout6 reopened this Oct 12, 2015
@mtscout6 mtscout6 changed the title Sourcemap support Add input AST with SourceMap attribution support Oct 12, 2015
@inukshuk
Copy link

@mtscout6 thanks for the confirmation. Not much time this week either, but I'll see if I can take a stab at it,

@ericnewton76
Copy link

ericnewton76 commented Sep 28, 2016

looks like this is still waiting to be implemented

i see that v3.1.10 has sourcemaps support... awesome!

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

No branches or pull requests

9 participants