watchalive-less
raw JSON → 0.1.1 verified Fri May 01 auth: no javascript
A Less/CSS transpiler plugin for the watchalive file-watching and live-reload system. Version 0.1.1 is the initial release, designed to compile Less files to CSS automatically during development. It serves as an alternative to using the standalone lessc compiler or other build-tool integrations, tightly coupled with the watchalive ecosystem for seamless file monitoring and CSS injection.
Common errors
error Error: Cannot find module 'watchalive-less' ↓
cause Package not installed or not in node_modules
fix
Run 'npm install watchalive-less --save-dev' and ensure it's in the same directory as your script.
error TypeError: watchalive.create is not a function ↓
cause watchalive not imported correctly or version mismatch
fix
Ensure you have watchalive installed and use const watchalive = require('watchalive');
error Error: Plugin 'watchalive-less' is not a valid plugin ↓
cause Incorrect usage of the plugin object
fix
Use require('watchalive-less') as the plugin entry, not a constructor.
Warnings
gotcha No README or documentation provided in the package; usage relies solely on understanding watchalive's plugin API. ↓
fix Refer to watchalive documentation for plugin integration patterns.
gotcha Package is CommonJS-only; attempting ESM imports may fail. ↓
fix Use require() instead of import.
gotcha No TypeScript type definitions included. ↓
fix Create custom declaration or use @types if available.
Install
npm install watchalive-less yarn add watchalive-less pnpm add watchalive-less Imports
- watchalive-less wrong
import watchaliveLess from 'watchalive-less'correctrequire('watchalive-less') - LessPlugin wrong
const { LessPlugin } = require('watchalive-less')correctconst LessPlugin = require('watchalive-less').LessPlugin - default wrong
import lessPlugin from 'watchalive-less'correctconst lessPlugin = require('watchalive-less')
Quickstart
const watchalive = require('watchalive');
const lessPlugin = require('watchalive-less');
watchalive.create({
port: 3001,
root: './src',
plugins: [lessPlugin],
// Other watchalive options
}).start();