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

LESS doesn’t create a map from closed bracket } #2413

Open
bassjobsen opened this issue Jan 24, 2015 · 6 comments
Open

LESS doesn’t create a map from closed bracket } #2413

bassjobsen opened this issue Jan 24, 2015 · 6 comments
Labels

Comments

@bassjobsen
Copy link
Contributor

See: gulp-community/gulp-less#126

Related issues: gulp-community/gulp-less#126

@lukeapage
Copy link
Member

@bassjobsen I can't reproduce any problem, could you add more detail? I've tried a few examples from the linked bug but I think I need
a. test case (or x always happens in this case)
b. actual output
c. expected output

@bassjobsen
Copy link
Contributor Author

Hi Luke,
Firstly, i don't want to bother you with any unsolved or vague questions.

In short what i found:

my Less file, t.less:

p {
color: red; 
}

Then i run: lessc t.less t.css --source-map --autoprefix

t.css.map now contains:

{"version":3,"sources":["t.less","t.css"],"names":[],"mappings":"AAAA;EACA,YAAA;ECCC","file":"t.css"}

without the autoprefixer: lessc t.less t.css --source-map the sourcemap looks like that shown below:

{"version":3,"sources":["t.less"],"names":[],"mappings":"AAAA;EACA,UAAA","file":"t.css"}

As you can see after running the autoprefixer the output don't change, but the sourcemap does and adds
the output file as an source. As far as i do understand and can test, this also differs from the same code in SASS.
see: ai/autoprefixer-core#27 (comment)

After all i think the right outcome of the above is possible ambiguous cause in the situation that the autoprefixer adds some rules what should be the source of these rules?

So again i don't want to waste your time. I'm not sure it is an issue indeed and i'm also not sure if it will hurt someone.

@lukeapage
Copy link
Member

Ah yes, this is the issue i raised with a-p which they just closed. I will
look at the linked issue again and try if it can be fixed.

@boogerlad
Copy link

related: sindresorhus/gulp-autoprefixer#10

@wolfy1339
Copy link

This is still a problem in 2.7.1

@BrianMulhall
Copy link

this is still a problem in 3.11.1. The source map has no mapping made for closing brackets. I zipped up the source less file, the source map that get generated and the output css file.

If it helps to see the bug yu can go here https://sokra.github.io/source-map-visualization/#custom and load the files in to visualization tool and see the bug for yourself.

The reason this is such a pain is when you are applying mulitple stages of transformations to a file

For example Less -> CSS -> Autoprefixed CSS -> concatenated CSS file
To make source maps that go from the last stage back to the first each map needs to be complete

less_bug.zip

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

No branches or pull requests

5 participants