Adds output of all top-level variables to a JSON file
npm install --save-dev less-plugin-variables-output
lessc --variables-output <input.less> <output.css>
lessc --variables-output=customFilename.json <input.less> <output.css>
const less = require('less');
const VariablesOutput = require('less-plugin-variables-output');
less.render(<css>, {
plugins: [
new VariablesOutput({
filename: 'variables.json'
})
]
});
npm test