V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 外包信息请发到 /go/outsourcing 节点。
• 不要把相同的信息发到不同的节点
troycode
V2EX  ›  酷工作

使用 next.js,为何生成一堆类缓存文件,如何在提交 git 的时候隐藏掉?

  •  
  •   troycode · Jun 8, 2020 · 2157 views
    This topic created in 2149 days ago, the information mentioned may be changed or developed.

    |
    modified: .next/build-manifest.json
    modified: .next/server/pages-manifest.json
    modified: .next/server/static/development/pages/_app.js
    modified: .next/static/development/pages/_app.js
    modified: .next/static/runtime/main.js
    modified: .next/static/runtime/webpack.js

    6 replies    2020-06-09 14:17:30 +08:00
    rabbbit
        1
    rabbbit  
       Jun 8, 2020
    .gitignore
    troycode
        2
    troycode  
    OP
       Jun 8, 2020
    @rabbbit 已经加上了,还不行
    # next files
    .next/
    out/
    nwu2Cv8OZ2MZMg39
        3
    nwu2Cv8OZ2MZMg39  
       Jun 8, 2020
    /.next
    nwu2Cv8OZ2MZMg39
        4
    nwu2Cv8OZ2MZMg39  
       Jun 8, 2020
    不加 /,会被认为是扩展名,不会被识别为目录
    Vegetable
        5
    Vegetable  
       Jun 8, 2020
    你这些文件已经在仓库里了,现在加 ignore 没用了, git rm --cached .next/* 先从仓库删除
    darrenfang
        6
    darrenfang  
       Jun 9, 2020
    .gitignore 里面添加这个就行了

    # next.js build output
    .next


    按照 @Vegetable #5 的方法先把仓库里面的文件删掉。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1154 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 23:12 · PVG 07:12 · LAX 16:12 · JFK 19:12
    ♥ Do have faith in what you're doing.