1

I can't figure out a way to detect unused LESS to remove it.

Since it is possible to do so with CSS (via uncss), there has to be a way to use the mappings and get instructions on which LESS parts to remove. So how can I use uncss and the mappings to actually make this happen?

This question is similar but is only about variables.

Thank you in advance for any help

brclz
  • 806
  • 9
  • 23
  • AFAIR there's no tools or libs that can manipulate Less code (not counting compilers themselves). – seven-phases-max Nov 01 '16 at 13:35
  • 1
    Also the mappings trick (in case one is planning to make such tool) is not that helpful actually: CSS mapping just points to the beginning of some statement but neither marks the end of the statement nor marks any outer statements it could depend on. Take for instance a trivial [loop](http://lesscss.org/features/#loops-feature) - sourcemap will point you to just `width: (10px * @counter);` line but won't give any hint on how and where `@counter` comes from. So in general a much deeper analysis is required. – seven-phases-max Nov 01 '16 at 13:36
  • True @seven-phases-max. I will have to find a solution anyway, since it can't be hand-made due to the huge amount of files I need to process. Still looking into it... – brclz Nov 04 '16 at 11:52
  • 1
    found anything? – Aflred Feb 12 '18 at 00:52

0 Answers0