less / less-plugin-autoprefix

Adds the ability for less to be post-processed by autoprefixer
Apache License 2.0
170 stars 32 forks source link

sourceMap.getExternalSourceMap() returns wrong source path??? #4

Closed bassjobsen closed 10 years ago

bassjobsen commented 10 years ago

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"}

lukeapage commented 10 years ago

Its not intended. I think its a postcss bug - I've raised it here https://github.com/postcss/postcss/issues/117

lukeapage commented 10 years ago

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.