Vite plugin for LiveStyleSync – a real-time CSS patching tool that writes style changes directly to source files via a WebSocket server. Current stable version is 1.1.0. Requires Vite >=4 and the complementary livestylesync-overlay package. Unlike traditional CSS-in-JS or hot-reload mechanisms, LiveStyleSync modifies source files (CSS, SCSS, CSS Modules, Vue scoped styles) using PostCSS AST and relies on Vite's HMR to reflect changes. It is released as an open-source MIT-licensed package. This plugin is the server-side counterpart; the browser overlay handles user-initiated style edits and sends patches to the WS server. Release cadence is irregular; recent versions have focused on stability and compatibility with Vite 4+. It differentiates itself by preserving source file updates rather than injecting runtime styles, making it suitable for design-to-code workflows.
npm install livestylesync-vite-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Vite configuration enabling LiveStyleSync plugin with customizable WebSocket port, using environment variable for port number.
Ensure both plugin and overlay use the same port. If you rely on the default, set port: 3100 explicitly in plugin options.
npm install livestylesync-overlay livestylesync-vite-plugin
Convert to ESM: update project to use ES modules, or use dynamic import() for CommonJS projects.
Use configureDevServer. Ensure the plugin is only applied in development mode.
Replace all references to 'UserPluginConfig' with 'LiveStyleSyncOptions'.
npm install vite@4
Use named import: import { liveStyleSync } from 'livestylesync-vite-plugin'Ensure overlay mount({ port: 3100 }) matches plugin default or set plugin port explicitly.Use import statement or switch to ESM project.