1.0.1 • Published 4 years ago
@ken20001207/less-2-css v1.0.1
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 --writeInstall as a devDependency and use it in your project:
$ pnpm i @ken20001207/less-2-css -D
$ pnpx less-2-css ./src --writeHow it works
- Scan all files in the project.
- Once found a
.lessfile, use postcss to convert it to css file. - Validate the css file with csstree-validator.
- If it is valid, this file can be safely rename to
.css. - Modify the import path in
.js,.jsx,.ts,.tsxfile from.lessto.css.
Example
You can see this example in /test/example.
Before


After

