Noticeably Playful Monkeys

    craco-less-plugin

    0.0.3 • Public • Published

    MIT License

    Craco Less Plugin

    This is a craco Less & Less Modules plugin, support create-react-app version >= 3.

    Installation

    Then install craco-less-plugin:

    $ yarn add craco-less-plugin

    Usage

    Here is a complete craco.config.js configuration file that adds Less compilation to create-react-app:

    const CracoLessPlugin = require('craco-less-plugin')
    module.exports = {
      plugins: [{ plugin: CracoLessPlugin }]
    }

    Options

    View the less-loader documentation

    For example:

    const CracoLessPlugin = require('craco-less-plugin')
     
    module.exports = {
      plugins: [
        {
          plugin: cracoLessPlugin,
          options: {
            modifyVars: {
              hack: `true;@import "${require.resolve('./src/theme.less')}";`
            },
            javascriptEnabled: true
          }
        }
      ]
    }

    CSS Modules

    using the [name].module.less file naming convention

    For example:

    Button.module.less

    .button {
      background-color: red;
    }

    License

    MIT

    Install

    npm i craco-less-plugin

    DownloadsWeekly Downloads

    111

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    5.08 kB

    Total Files

    7

    Last publish

    Collaborators

    • jaskang