Uses postcss-preset-env
to convert modern css syntax and determine required polyfills after conversion from less.
pnpm add -D postcss postcss-preset-env less-plugin-preset-env
lessc file.less --preset-env="browsers"
The browsers are a comma seperated list of browsers as specified with preset-env.
var LessPluginPresetEnv = require('less-plugin-preset-env'); // or
// import LessPluginPresetEnv from 'less-plugin-preset-env';
/** @see https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env#options */
var options = {};
less.render(lessString, { plugins: [new LessPluginPresetEnv(options)] })
.then(
Browser usage is not supported at this time.