Parcel supports Less files out of the box by utilizing the
@parcel/transformer-less plugin, under the hood this plugin uses the
less npm package.
In the default Parcel config, the compiled Less files are also processed by PostCSS (meaning PostCSS plugins are executed and CSS modules just work:
import * as styles from "./style.module.less";).
¶ Example Usage
You can also directly include the Less file in a HTML file.
<link rel="stylesheet" href="./style.less" />
Directly compile Less using the Parcel CLI
parcel build ./style.less
To configure Less we support the following configuration files:
.lessrc.js (we highly recommend to use the JSON version whenever possible for the best performance/cache experience)
To see the available options to configure Less see the official Less documentation.