Package Exports
- @docusaurus-plugin/less
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@docusaurus-plugin/less) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@docusaurus-plugin/less
support less in docusaurus
Support less stylesheet language in docusaurus v2.
Installation
- using npm
$ npm i @docusaurus-plugin/less less less-loader -D- using yarn
$ yarn add @docusaurus-plugin/less less less-loader -DHow to use
Without less-loader options
// docusaurus.config.js module.exports = { // omit unrelated docusaurus options plugins: ['@docusaurus-plugin/less'] }
With less-loader options
// docusaurus.config.js module.exports = { plugins: [ '@docusaurus-plugin/less', { // less-loader options // https://github.com/webpack-contrib/less-loader#options } ] }
Regular less
// App.tsx
import './global.less'Less CSS Modules
// Button.tsx
import styles from './button.module.less'
export default function Button({ children }) {
return <button classNames={styles.button}>{children}</button>
}