diff --git a/.bash_exports b/.bash_exports index c79aefe8..caba5aad 100644 --- a/.bash_exports +++ b/.bash_exports @@ -28,3 +28,15 @@ fi if [ -f "$HOME/ppv/pillars/dotfiles/flywire-notes/bash-config.sh" ]; then source "$HOME/ppv/pillars/dotfiles/flywire-notes/bash-config.sh" fi + +# Default Patchright backend for Playwright (global, non-intrusive) +# If a user-level module alias exists at ~/.config/node-module-alias/node_modules, +# add it to NODE_PATH so that require('playwright') resolves to Patchright. +# This avoids wrapper scripts and per-repo code changes. +export PATCHRIGHT_MODULE_ROOT="$HOME/.config/node-module-alias/node_modules" +if [ -d "$PATCHRIGHT_MODULE_ROOT" ]; then + case :$NODE_PATH: in + *:$PATCHRIGHT_MODULE_ROOT:*) ;; + *) export NODE_PATH="$PATCHRIGHT_MODULE_ROOT:${NODE_PATH}" ;; + esac +fi