https://github.com/exphat/compiless
📝 Compile LESS files throughout a directory tree
https://github.com/exphat/compiless
Last synced: 7 months ago
JSON representation
📝 Compile LESS files throughout a directory tree
- Host: GitHub
- URL: https://github.com/exphat/compiless
- Owner: exPHAT
- License: mit
- Created: 2015-10-02T23:03:14.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T04:58:17.000Z (over 3 years ago)
- Last Synced: 2025-03-20T17:50:07.615Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 68.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# compiLESS
[](https://magnum.travis-ci.com/ExPHAT/compiless)
[](https://npmjs.org/package/compiless)
Compiles LESS files throughout a directory tree and exports them to a specific directory.
## Usage
Install the package
```shell
$ npm install compiless
```
Then in some file that is called upon app start (should only be called once):
```js
import compiless from "compiless";
async main() {
await compiless(__dirname, {
"./src/less": "./public/css"
});
// Rest of your app code here
}
```
Or, you can choose to not use async/await:
```js
import compiless from "compiless";
function main() {
compiless(__dirname, {
"./src/less": "./public/css"
}).then(function() {
// Do something here!
});
}
```
This will take any LESS files from the `src/less` directory, compile them, and export them to the `public/css` directory. So that they can be statically served.
## Important notes
- Found directories will be recursively searched.
- If a directory does not exist, it will be created.
- Previous files at a path **WILL** be overwritten
## Running tests
Clone this repo
```shell
$ git clone https://github.com/exPHAT/compiless.git
```
Install all of the dependencies
```shell
$ npm install
```
Build & run the tests
```shell
$ npm test
```
Build the project on its own
```shell
$ npm run build
```