Closed zspitzer closed 5 years ago
We use server-side post-commit hooks to deploy changes to server. Thus we add map files to git. Full path in "sources" makes work very annoying when your colleague change something in css and your working copy became partially invalid.
I'm amazed that, about a year later, this hasn't had much attention. It's a rather important feature for users who have workflows similar to the one mentioned above, where map files are committed into VCS. This can be rather bothering since absolute paths -- meaning personal OS file tree structure is also committed into VCS -- might contain sensitive information.. Might, may not, but it is a possibility
Here's a possible solution. Replace path.resolve
with path.relative
, just as is, having return relative paths with regards to the cwd
to the input and/or output files.
https://github.com/css/csso-cli/blob/f79854f3c67ce6f49d0dfb72b5c23d32395e012b/index.js#L207-L215
Could be made an option, so one could optionally relativize paths and keep the absolute path alternative baked in as well.
@lahmatiy any chance you could get this fixed? I'm looking into switching to csso and it seems we are hitting this issue.
@XhmikosR Yes, I'll try to figure it out now.
@lahmatiy: there's still an issue on Windows with v2.0.0:
dist\\css\\bootstrap-grid.css
I suggest that you either enable Windows testing on Travis or add AppVeyor :)
It's seems source map is including full paths rather than relative files
{"version":3,"sources":["W:\test\css\index.css"],"names":[],"mappings":....
i'd expect to see
{"version":3,"sources":["index.css"],"names":[],"mappings":...
running win10
css/csso#348