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

Create sourcemaps for sass files #477

Closed
dpashkevich opened this issue Feb 7, 2014 · 9 comments
Closed

Create sourcemaps for sass files #477

dpashkevich opened this issue Feb 7, 2014 · 9 comments

Comments

@dpashkevich
Copy link
Contributor

And possibly for other CSS preprocessor syntaxes.

@dpashkevich
Copy link
Contributor Author

We probably need to copy the styles to tmp/styles and configure grunt-sass accordingly

@stefanpenner
Copy link
Owner

@dpashkevich do you have extra bandwidth to help out on this?

@stefanpenner
Copy link
Owner

i think the feature sounds great

@dpashkevich
Copy link
Contributor Author

Trying right now, I'm still wrapping my head around the kit but this one looks simple

@stefanpenner
Copy link
Owner

@dpashkevich wicked thanks!

@dpashkevich
Copy link
Contributor Author

Need some advice here. I'm looking at the source maps for JS and they simply embed the original sources (after es6 transpilation though) inside themselves under sourcesContent. This saves us from the headache of resolving the paths and exposing the source files via HTTP, BUT! This way, you can't edit the original files from the DevTools (well you can, but edits would not be persisted).

While that may be less critical for JS, I think we should take a different approach for styles, so we can live edit them in the browser and have the changes persist (I do that all the time with vanilla CSS). Off the top of my head, I don't see an easy solution for EAK as it does a lot of copying in its build process.

But anyway, sourcesContent is not yet supported in libsass (sass/libsass#212) so the best we can do at the moment is copy the original SASS/LESS/Stylus files inside /tmp/result/ so the browser can fetch them.

@dpashkevich
Copy link
Contributor Author

PS I didn't report that the sourceMap file actually does gets generated if we add the appropriate options to grunt-sass:

options: {
      sourceComments: 'map',
      sourceMap: 'tmp/result/assets/app.css.map'
    }

But the browser needs to be able to fetch the original files

@dpashkevich
Copy link
Contributor Author

Note to self: don't forget to make autoprefixer re-generate whatever sourcemap's there to the final version

@stefanpenner
Copy link
Owner

closing in favour of PR

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

No branches or pull requests

2 participants