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

Using sourceMapBasepath has no effect #1781

Closed
command-tab opened this issue Jan 6, 2014 · 3 comments
Closed

Using sourceMapBasepath has no effect #1781

command-tab opened this issue Jan 6, 2014 · 3 comments

Comments

@command-tab
Copy link

This might be related to #1740, but when I use the sourceMapBasepath option, it doesn't affect my sourceMap file in any way. I'm expecting to be able to change the public/css/app.less path in the beginning of the file when doing server-side preprocessing:

{"version":3,"sources":["public/css/app.less"],"names":[],"mappings":"

In my Gruntfile, I can set sourceMapBasepath to anything, say, qwerty, and upon re-running the Grunt task, and the sourceMap is identical to the previous run.

I'm wanting to change that .less path because the static content the webserver serves up lives in public, and my .less files are also in there, and that public directory is ending up in the sourceMap, but it's my webserver root and should not be mentioned.

I created a minimal test case here:
http://static.command-tab.com/temp/someapp.zip
Run npm install && grunt to build it.

Observe that app.less is a simple LESS file, and the Grunt task creates style.min.css and style.min.css.map. The CSS file points to the sourceMap thanks to the sourceMapURL option, but sourceMapBasepath didn't have any effect.

Am I missing something, or is this a bug?

@janraasch
Copy link

You are missing something :)

Here you can see what the sourceMapBasepath option actually does.

If I understood your setup correctly, you probably want to set your sourceMapBasepath to public.

@lukeapage
Copy link
Member

closing due to lack of response.

@katrotz
Copy link

katrotz commented Apr 25, 2017

@commandtab Had a look into the less source code, the sourceMapBasepath works only when the sourceMap file path starts with sourceMapBasepath path.
Eg. sourceMapBasepath = 'src' will work only when the sourcemap sources start with 'src'

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

4 participants