V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
troycode
V2EX  ›  酷工作

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

  •  
  •   troycode · 2020-06-08 17:43:53 +08:00 · 1694 次点击
    这是一个创建于 1417 天前的主题,其中的信息可能已经有所发展或是发生改变。

    |
    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 条回复    2020-06-09 14:17:30 +08:00
    rabbbit
        1
    rabbbit  
       2020-06-08 17:46:02 +08:00
    .gitignore
    troycode
        2
    troycode  
    OP
       2020-06-08 17:52:11 +08:00
    @rabbbit 已经加上了,还不行
    # next files
    .next/
    out/
    VikingX
        3
    VikingX  
       2020-06-08 17:58:01 +08:00
    /.next
    VikingX
        4
    VikingX  
       2020-06-08 17:58:37 +08:00
    不加 /,会被认为是扩展名,不会被识别为目录
    Vegetable
        5
    Vegetable  
       2020-06-08 18:00:57 +08:00
    你这些文件已经在仓库里了,现在加 ignore 没用了, git rm --cached .next/* 先从仓库删除
    darrenfang
        6
    darrenfang  
       2020-06-09 14:17:30 +08:00
    .gitignore 里面添加这个就行了

    # next.js build output
    .next


    按照 @Vegetable #5 的方法先把仓库里面的文件删掉。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5603 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 03:29 · PVG 11:29 · LAX 20:29 · JFK 23:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.