mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
fix(javascript): use top-level node_modules in monorepos
This commit is contained in:
@ -34,7 +34,8 @@ ignore the cache."
|
|||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +javascript-add-npm-path-h ()
|
(defun +javascript-add-npm-path-h ()
|
||||||
"Add node_modules/.bin to `exec-path'."
|
"Add node_modules/.bin to `exec-path'."
|
||||||
(when-let ((node-modules-parent (locate-dominating-file default-directory "node_modules/"))
|
(when-let ((search-directory (or (doom-project-root) default-directory))
|
||||||
|
(node-modules-parent (locate-dominating-file search-directory "node_modules/"))
|
||||||
(node-modules-dir (expand-file-name "node_modules/.bin/" node-modules-parent)))
|
(node-modules-dir (expand-file-name "node_modules/.bin/" node-modules-parent)))
|
||||||
(make-local-variable 'exec-path)
|
(make-local-variable 'exec-path)
|
||||||
(add-to-list 'exec-path node-modules-dir)
|
(add-to-list 'exec-path node-modules-dir)
|
||||||
|
Reference in New Issue
Block a user