@ken20001207/less-2-css
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

less-2-css

Automatically convert those .less file which is not using less function to .css.

Why

Less is a powerful CSS pre-processor, but it also very slow. We want use it only when we need it.

Usage

Directly use it without install it into your project:

$ pnpx @ken20001207/less-2-css ./src --write

Install as a devDependency and use it in your project:

$ pnpm i @ken20001207/less-2-css -D
$ pnpx less-2-css ./src --write

How it works

  1. Scan all files in the project.
  2. Once found a .less file, use postcss to convert it to css file.
  3. Validate the css file with csstree-validator.
  4. If it is valid, this file can be safely rename to .css.
  5. Modify the import path in .js, .jsx, .ts, .tsx file from .less to .css.

Example

You can see this example in /test/example.

Before

After

Readme

Keywords

none

Package Sidebar

Install

npm i @ken20001207/less-2-css

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

16.1 kB

Total Files

16

Last publish

Collaborators

  • ken20001207