-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Sourcemap basepath could apply to paths written in .map file #1740
Comments
Hi, What does appear in the sources section ? is it "WebContent/brand/css/brand.less" or is it "FULL_PATH/WebContent/brand/css/brand.less" ? We do use the basepath option for sources and we do not have just a generic number of directories because we are better than that - directories are more specific and stop confusion because we import files over sub directories. use the inline options if you like - then you don't need to worry what paths you get. |
Hi @lukeapage - thanks for your info so far... |
are all the path seperators consistent? We did fix a bug this release where they weren't being 100% normalised. I know people are using grunt-contrib-less and the base path option and its working for them, so I just need a full example of where its not. if you can put a cut down example somewhere it would be very useful. |
closing from lack of response |
This is related to:
#1050 - Allow creating a source map
#1543 - Sourcemap basepath option
There's a real need to support the ability to trim some of the prefixing folders in the paths written into the sourcemap file. I expected the source-map-basepath to do this but on inspection it only alters the path written in the compressed css.
I have a path required for the compiler to see in order to find files for reading and writing, but the resultant source map shouldn't reference it, as the web server treats the first subdirectory as the root to serve from.
For JS, UglifyJS2 provides for:
I actually use: grunt-contrib-uglify in grunt which wraps this as:
The result of using that would mean i could pass in 'WebContent/brand/css/brand.less' as a source but specify SourceMapPrefix of 1 and have the sources array in the sourcemap file write out ''brand/css/brand.less'. In combination with a set sourceMapRootpath of '/new/' i could get "/new/brand/css/brand.less" written in the sourcemap sources array items.
Then everything would work.
Personally i like option (a) where specifying a basePath string would apply it to the source paths too as it does to the source map url. Perhaps a toggle to enable that?
Sorry for the long winded post.
The text was updated successfully, but these errors were encountered: