Skip to content

Commit

Permalink
feat(programmmmming-language-support): Add in live-server.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzaaft committed Nov 16, 2024
1 parent ea0b4c3 commit 84c250c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# live-server.nvim

Live reload local development servers inside of neovim

Requires:

One of the following:

- [bun](https://bun.sh/)
- [pnpm](https://pnpm.io/)
- [yarn](https://yarnpkg.com/)
- [npm](https://www.npmjs.com/)

**Repository:** <https://github.com/barrett-ruth/live-server.nvim>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
return {
"barrett-ruth/live-server.nvim",
lazy = true,
build = function()
--- NOTE: Order of preference:
--- bun / pnpm / yarn / npm
local package_manager = vim.fn.executable "bun" and "bun"
or vim.fn.executable "pnpm" and "pnpm"
or vim.fn.executable "yarn" and "yarn"
or vim.fn.executable "npm" and "npm"
or false

if not package_manager then
error "Missing one of the following node.js package managers: bun, pnpm, yarn, or npm "
end
local cmd = string.format("%s install --frozen-lockfile", package_manager)
vim.cmd(cmd)
end,
cmd = { "LiveServerStart", "LiveServerStop" },
opts = {},
}

0 comments on commit 84c250c

Please sign in to comment.