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.

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.
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.
npm install watchalive-less
yarn add watchalive-less
pnpm add watchalive-less

Sets up a watchalive server with the Less transpiler plugin, watching ./src directory for changes and compiling Less files to CSS.

const watchalive = require('watchalive');
const lessPlugin = require('watchalive-less');

watchalive.create({
  port: 3001,
  root: './src',
  plugins: [lessPlugin],
  // Other watchalive options
}).start();