встроенная меньше исходная карта, скомпилированная из кода узла

Проект, над которым я работаю, использует код для запуска компилятора less.

У меня возникли проблемы с добавлением встроенной исходной карты в скомпилированный css из моих файлов less. С узла мы запускаем следующий код:

var less = require('less'),
    options = {
        strictMath: true
    };

less.render(data, options, function(err, css) {
    callback(err, css);
});

Есть ли вариант, который я могу добавить? Я безуспешно пытался добавить sourceMap: true и outputSourceFiles: true.


person Nahkala    schedule 01.11.2013    source источник
comment
Вы можете дважды проверить свою версию LESS, LESS.js поддерживает только исходные карты с версии 1.5.   -  person am80l    schedule 09.09.2014


Ответы (1)


Начиная с Less v 1.5 компилятор поддерживает следующие параметры

  --source-map[=FILENAME]  Outputs a v3 sourcemap to the filename (or output filename.map)
  --source-map-rootpath=X  adds this path onto the sourcemap filename and less file paths
  --source-map-basepath=X  Sets sourcemap base path, defaults to current working directory.
  --source-map-less-inline puts the less files into the map instead of referencing them
  --source-map-map-inline  puts the map (and any less files) into the output css file
  --source-map-url=URL     the complete url and filename put in the less file

Варианты sourceMap и outputSourceFiles, которые вы пробовали, похоже, связаны с grunt-contrib-less, см.: https://github.com/gruntjs/grunt-contrib-less

person Bass Jobsen    schedule 05.10.2014