You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Laravel Pint配置中exclude参数未生效问题求助

Laravel Pint 配置中exclude参数失效的解决方案
  • 核心问题原因:当你在命令行直接指定要处理的目录(比如执行 vendor/bin/pint bootstrap),Pint 会跳过配置文件里的 exclude 规则,优先处理你明确指定的路径——这是工具的设计逻辑,命令行指定的目标会覆盖配置中的排除项。

  • 可行解决方案:

    1. 不指定具体目录,直接执行 vendor/bin/pint,此时 Pint 会读取配置文件的 exclude 规则,自动跳过 bootstrap/cache 目录。
    2. 如果只想处理 bootstrap 目录但排除 cache 子目录,直接用命令行的 --exclude 参数:
      vendor/bin/pint bootstrap --exclude bootstrap/cache
      
    3. 配置文件可以简化写法(你的原有写法本身没问题,但仅在不指定命令行路径时生效):
      {
        "preset": "laravel",
        "exclude": [
          "bootstrap/cache"
        ]
      }
      

内容的提问来源于stack exchange,提问作者fence

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 02:33:10