sourceMap.getExternalSourceMap() returns wrong source path???
bassjobsen opened this issue · 2 comments
When i compile a file in a directory (/test/
) by running lessc --source-map --verbose --autoprefix='Android 2.3' test/t.less t.css
and evaluate the result of sourceMap.getExternalSourceMap()
.
I found:
{ _file: 't.css',
_sourceRoot: null,
_sources:
{ _array: [ 'test/test/t.less', 'test/t.less' ],
_set: { '$test/test/t.less': 0, '$test/t.less': 1 } },
_names: { _array: [], _set: {} },
_mappings:
Now i wonder if the double test/test is the correct and expected result?
Possible related. When i run a second postproccesor after the autoprefixer which reload the sourcemap with the same postcss methods, i found that it result in the following error:
Error: Unsupported previous source map format: {"version":3,"sources":["less/less/t.less","less/t.less"],"names":[],"mappings":"AAMA;EALA;IACA,gCAAA;YAAA,wBAAA;ICCG;EACF;ADQD;EALA;IACA,gCAAA;YAAA,wBAAA;ICAG;EACF;ADYD;EARA;IACA,gCAAA;YAAA,wBAAA;ICDG;EACF","file":"t.css"}
Its not intended.
I think its a postcss bug - I've raised it here postcss/postcss#117
I give up trying to get postcss to fix anything. I've raised 2 bugs and both were misunderstood and its still not fixed.
I've changed to something different that results in a bloated double size source map, but at least it works.