@kkt/less-modules
TypeScript icon, indicating that this package has built-in type declarations

7.5.5 • Public • Published

@kkt/less-modules

npm version

Use create-react-app to build react libraries. Support for regular less files and *.module.less files. This package contains a plugin for using Less with kkt.

Installation

yarn add --dev @kkt/less-modules
# or use npm if you don't have yarn yet
npm install --save-dev @kkt/less-modules

Usage

In the .kktrc.js or .kktrc.ts you created for kkt add this code:

import lessModules from '@kkt/less-modules';

export default (conf, evn, options) => {
  conf = lessModules(conf, evn, options);

  // with loaderOptions
  conf = lessModules.withLoaderOptions({
    modifyVars: {
      "@primary-color": "#1890ff",
    },
  })(config, env, options);

  return conf;
}

In package.json, add a separate npm script to build library

{
  "scripts": {
    ...
    "bundle": "kkt build --bundle",
    "bundle:min": "kkt build --bundle --mini",
    ...
  }
}

And you can now use CRA to build your library

Configurations

import lessModules from '@kkt/less-modules';

export default (conf, evn, options) => {

  // with loaderOptions
  conf = lessModules.withLoaderOptions({
    lessOptions: {
      modifyVars: {
        "@primary-color": "#1890ff",
      },
    }
  })(conf, env, options);

  return conf;
}

License

Licensed under the MIT License

Readme

Keywords

Package Sidebar

Install

npm i @kkt/less-modules

Weekly Downloads

123

Version

7.5.5

License

MIT

Unpacked Size

10.1 kB

Total Files

5

Last publish

Collaborators

  • uiwjs
  • wcjiang