@@ -517,6 +517,21 @@ fn build_pack_cache_inputs() -> Vec<UserInputEntry> {
517517 ]
518518}
519519
520+ /// Cache input entries for the check command.
521+ /// The vp check subprocess is a full vp CLI process (not resolved to a binary like
522+ /// build/lint/fmt), so it accesses additional directories that must be excluded:
523+ /// - `.vite-temp`: config compilation cache, read+written during vp CLI startup
524+ /// - `.vite/task-cache`: task runner state files that change after each run
525+ fn check_cache_inputs ( ) -> Vec < UserInputEntry > {
526+ vec ! [
527+ UserInputEntry :: Auto ( AutoInput { auto: true } ) ,
528+ exclude_glob( "!node_modules/.vite-temp/**" , InputBase :: Workspace ) ,
529+ exclude_glob( "!node_modules/.vite-temp/**" , InputBase :: Package ) ,
530+ exclude_glob( "!node_modules/.vite/task-cache/**" , InputBase :: Workspace ) ,
531+ exclude_glob( "!node_modules/.vite/task-cache/**" , InputBase :: Package ) ,
532+ ]
533+ }
534+
520535fn merge_resolved_envs (
521536 envs : & Arc < FxHashMap < Arc < OsStr > , Arc < OsStr > > > ,
522537 resolved_envs : Vec < ( String , String ) > ,
@@ -587,10 +602,14 @@ impl CommandHandler for VitePlusCommandHandler {
587602 } ;
588603 match cli_args {
589604 CLIArgs :: Synthesizable ( SynthesizableSubcommand :: Check { .. } ) => {
590- // Check is a composite command — run as a subprocess in task scripts
591- Ok ( HandledCommand :: Synthesized (
592- command. to_synthetic_plan_request ( UserCacheConfig :: disabled ( ) ) ,
593- ) )
605+ // Check is a composite command (fmt + lint) — run as a subprocess in task scripts
606+ Ok ( HandledCommand :: Synthesized ( command. to_synthetic_plan_request (
607+ UserCacheConfig :: with_config ( EnabledCacheConfig {
608+ env : Some ( Box :: new ( [ Str :: from ( "OXLINT_TSGOLINT_PATH" ) ] ) ) ,
609+ untracked_env : None ,
610+ input : Some ( check_cache_inputs ( ) ) ,
611+ } ) ,
612+ ) ) )
594613 }
595614 CLIArgs :: Synthesizable ( subcmd) => {
596615 let resolved =
0 commit comments