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: Prevent the reference to the css.map #844

Closed
wants to merge 1 commit into from

Conversation

gcastre
Copy link
Contributor

@gcastre gcastre commented Apr 3, 2014

LESS: Prevent the reference to the css.map in the css result if the option is disabled

If you disable the source map generation from less the css has the reference to the css.map.
This happen because of the change in am11@5a826c7 removing the check to WESettings.Instance.Less.GenerateSourceMaps before adding the --source-map-basepath=\"{0}\" --source-map=\"{1}\" to the less compiler command line.

@am11
Copy link
Contributor

am11 commented Apr 3, 2014

This is wrong; see this #833. Its part of making map file generation independent of settings (for editor enhancement features; CSS specificity, Go To Definition and getting full selector path to show in the tooltip).

If the map file option is set, it will keep, otherwise delete the map file after parsing via CssSourceMap.

So please add this code:

if (!GenerateSourceMap)
    File.Delete(MapFileName);

after ExecutorBase.cs Line 75.

and rebase. I missed it between the commits and rebasing.

BTW, this functionality goes for both LESS and SCSS.

@gcastre
Copy link
Contributor Author

gcastre commented Apr 4, 2014

I'm not talking about generating .css.map files (it works fine for me with the current 2.0). I'm talking about having now in *.css files the

/*# sourceMappingURL=site.css.map */ reference even with the .css.map disable...

@am11
Copy link
Contributor

am11 commented Apr 4, 2014

Yes this will happen because we are generating maps for all cases. Source-map comment is something we should handle in post processing phase, without changing the compiler switches.

On that note, we can use ReadAllLines and then WriteAllLines minus the last one. The post-processing step happens in CssCompilerBase class.

@am11
Copy link
Contributor

am11 commented Apr 4, 2014

This is fixed by am11@c058263 via #849.

@madskristensen, #849 fixes this issue. This needs to be closed without merging.

am11 added a commit to am11/WebEssentials2013 that referenced this pull request May 3, 2014
madskristensen#994 is duplicate of madskristensen#844 and its wrong.
This PR reverts it back.

We are creating source map for both LESS and SASS
regardless of settings. We are using these
interim maps for editor enhancements.

We extract out Base-64 VLQ values, decode it and
use that info for features which require
source-to-source mapping context (see madskristensen#787).

After parsing map files & extracting the desired
info, the map-file is deleted; if generate-map
option is disabled.
@am11 am11 mentioned this pull request May 3, 2014
SLaks pushed a commit to SLaks/WebEssentials2013 that referenced this pull request May 13, 2014
madskristensen#994 is duplicate of madskristensen#844 and its wrong.
This PR reverts it back.

We are creating source map for both LESS and SASS
regardless of settings. We are using these
interim maps for editor enhancements.

We extract out Base-64 VLQ values, decode it and
use that info for features which require
source-to-source mapping context (see madskristensen#787).

After parsing map files & extracting the desired
info, the map-file is deleted; if generate-map
option is disabled.
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.

2 participants