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

Adding sourcemaps for .scss in order to facilitate sourcemap support … #120

Merged
merged 1 commit into from
Jan 4, 2016

Conversation

tjnicolaides
Copy link
Contributor

…in Harp: sintaxi/harp#74.

How I'm currently implementing in a test project using terraform as a dependency:

planet.render('main.scss', { "title": "Override the global title" }, function(error, body, sourcemap){
  fs.writeFile(__dirname + '/main.css', body + '\n/*# sourceMappingURL=main.css.map */')
  fs.writeFile(__dirname + '/main.css.map', sourcemap)
});

@kennethormandy
Copy link
Collaborator

Thanks, getting sourcemaps into Terraform is super overdue, this might give us the push we need to add it for the rest of the preprocessors too.

@tjnicolaides
Copy link
Contributor Author

Thanks @kennethormandy -- I posted about continuing into Harp with this here if you would like to weigh in: sintaxi/harp#74 (comment)

@sintaxi
Copy link
Owner

sintaxi commented Nov 27, 2015

I'd love to have source maps implemented in a way that is uniform with every pre processor. I don't use source maps personally so I have no opinions on how it should be implemented or used but I understand a lot of people find them useful.

@sintaxi sintaxi merged commit 514205d into sintaxi:master Jan 4, 2016
@lunelson
Copy link
Contributor

lunelson commented Jan 5, 2016

I'm testing this through Harp with .scss files and it doesn't work for me. I harp init'd a project using my own boilerplate here https://github.com/lunelson/hb-default-scss, and I can access. main.css but DevTools sees no sourcemaps and no main.css.map file seems to exist. Does a change have to be made in Harp first, for this to kick in?

Just answered my own question: sintaxi/harp#523

@lunelson
Copy link
Contributor

I've tried this in a couple of projects and I believe I've determined, that the sourcemaps are not working when there are multiple nested levels of imports. In both projects I've got going with this, sourcemaps work for simpler structures but break down on complex imports such that all declarations are sourced to the same line in the same file.

@tjnicolaides
Copy link
Contributor Author

@lunelson are you able to provide a sample project where this is happening and can be reproduced?

I believe there was a part where the maps generated by the precompiler get passed along to autoprefixer that could be the culprit. I'd like to be able to see it happening and write a test for it, if possible.

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

Successfully merging this pull request may close these issues.

4 participants