feat: replace npm live-server with pure-Lua HTTP server (#29)
## Problem The plugin requires users to install Node.js and the `live-server` npm package globally. This is a heavyweight external dependency for what amounts to a simple local dev-server workflow, and it creates friction for users who don't otherwise need Node.js. ## Solution Replace the npm shell-out with a pure-Lua HTTP server built on `vim.uv` (libuv bindings), eliminating all external dependencies. The new server supports static file serving, SSE-based live reload, CSS hot-swap without full page reload, directory listings, and recursive file watching with configurable debounce. Minimum Neovim version is bumped to 0.10 for `vim.uv` and `vim.ui.open`. The old `args`-based config is automatically migrated with a deprecation warning. Closes #28.
This commit is contained in:
parent
baeb211719
commit
f42f958c24
17 changed files with 1097 additions and 298 deletions
22
README.md
22
README.md
|
|
@ -1,7 +1,12 @@
|
|||
# live-server.nvim
|
||||
|
||||
Live reload HTML, CSS, and JavaScript files inside Neovim with the power of
|
||||
[live-server](https://www.npmjs.com/package/live-server).
|
||||
Live reload HTML, CSS, and JavaScript files inside Neovim. No external
|
||||
dependencies — the server runs entirely in Lua using Neovim's built-in libuv
|
||||
bindings.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- Neovim >= 0.10
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
@ -12,12 +17,17 @@ Install with your package manager or via
|
|||
luarocks install live-server.nvim
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
- [live-server](https://www.npmjs.com/package/live-server) (install globally via npm/yarn)
|
||||
|
||||
## Documentation
|
||||
|
||||
```vim
|
||||
:help live-server.nvim
|
||||
```
|
||||
|
||||
## Known Limitations
|
||||
|
||||
- **No recursive file watching on Linux**: libuv's `uv_fs_event` only supports
|
||||
recursive directory watching on macOS and Windows. On Linux (inotify), the
|
||||
`recursive` flag is silently ignored, so only files in the served root
|
||||
directory trigger hot-reload. Files in subdirectories (e.g. `css/style.css`)
|
||||
will not be detected. See
|
||||
[libuv#1778](https://github.com/libuv/libuv/issues/1778).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue