@farmfe/js-plugin-less
Support less
for Farm.
Installation
- npm
- yarn
- pnpm
Usage
Options
lessOptions
Less options. See less options.
Example:
filters
Which files should be processed by less
. default to { resolvedPaths: ['\\.less$'] }
for load and { moduleTypes: ['less'] }
for transform.
resolvedPaths
: Only files under these paths will be processed. Support regex.moduleTypes
: Only files with these module types will be processed.
resolvedPaths
and moduleTypes
are unioned, which means files match any of them will be processed.
Example:
implementation
implementation
package name of less
. Default to less
.
additionalData
Additional data to be added to every less file. Example:
For less file:
index.less
additionalData
will be added to the top of the file:
index.less
Function form: