1 | let less = require('less')
|
2 | let sass2less = require('./lib/plugin')
|
3 | let fs = require('fs')
|
4 | let file
|
5 |
|
6 | // get a file
|
7 | fs.readFile('./node_modules/material-design-lite/src/_variables.scss', 'utf-8', function(err, contents) {
|
8 | if(err) return console.log(err)
|
9 | file = contents
|
10 |
|
11 | less.render(file, {
|
12 | plugins: [sass2less]
|
13 | }).then(function(output) {
|
14 | console.log(output.css)
|
15 | }, function (error) {
|
16 | console.log(error)
|
17 | })
|
18 | })
|