## 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.
36 lines
801 B
Nix
36 lines
801 B
Nix
{
|
|
description = "live-server.nvim — live reload for web development in Neovim";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
systems.url = "github:nix-systems/default";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
nixpkgs,
|
|
systems,
|
|
...
|
|
}:
|
|
let
|
|
forEachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
|
|
in
|
|
{
|
|
devShells = forEachSystem (pkgs: {
|
|
default = pkgs.mkShell {
|
|
packages = [
|
|
(pkgs.luajit.withPackages (
|
|
ps: with ps; [
|
|
busted
|
|
nlua
|
|
]
|
|
))
|
|
pkgs.prettier
|
|
pkgs.stylua
|
|
pkgs.selene
|
|
pkgs.lua-language-server
|
|
];
|
|
};
|
|
});
|
|
};
|
|
}
|