Closed cainiaokan closed 6 years ago
I ran into this as well and decided to just use lessc
manually. Here's what I did:
const lessPath = path.resolve(process.cwd(), './node_modules/.bin/lessc');
const result = spawnSync(lessPath, ['-'], {
input: data,
cwd: process.cwd(),
encoding: 'utf-8',
}).stdout;
Leaving this here for others as a possible work-around.
The option
preprocessCss
only accepts a synchronized method which takes the input and synchronously generate an output. However, less compiler doesn't have a synchronized method, its render method returns a promise object instead. So embarrassed...