Watch specified directory or file for changes to LESS files, and save the generated CSS where specified
Install from npm
npm i less-watch-compile
node node_modules/less-watch-compile -w <dir> -o <dir> -f <path> -m
--watch-directory, -w Directory to watch. Defaults to current directory if none is specified [string] [default: "./"]
--output-directory, -o Directory to output compiled LESS to [string] [required]
--file, -f Single file to watch [string]
--sourcemap, -m Enable generating of sourcemap [boolean]
Note, if both ---watch-directory and --file are used, --watch-directory will be ignored
Parent
|----src
|--------main.less
|----public
|--------styles
|------------main.css
|------------main.css.map
In the example directory above, the contents src/ can be compiled to public/styles/ using
node node_modules/less-watch-compile -w src -o public/styles
To only watch for main.less, use
node node_modules/less-watch-compile -f src/main.less -o public/styles
To include a sourcemap with main.css, use
node node_modules/less-watch-compile -f src/main.less -o public/styles -m
- Reduce delay in changes detection
If you find any bugs, please submit an issue. This project is still in a early stage, and any feedback would greatly help! :)
2.1.0
MIT