-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(programmmmming-language-support): Add in live-server.nvim
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
lua/astrocommunity/programming-language-support/live-server-nvim/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
21 changes: 21 additions & 0 deletions
21
lua/astrocommunity/programming-language-support/live-server-nvim/init.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = {}, | ||
} |