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

2020-06-08 17:43:53 +08:00
 troycode

|
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

1702 次点击
所在节点    酷工作
6 条回复
rabbbit
2020-06-08 17:46:02 +08:00
.gitignore
troycode
2020-06-08 17:52:11 +08:00
@rabbbit 已经加上了,还不行
# next files
.next/
out/
VikingX
2020-06-08 17:58:01 +08:00
/.next
VikingX
2020-06-08 17:58:37 +08:00
不加 /,会被认为是扩展名,不会被识别为目录
Vegetable
2020-06-08 18:00:57 +08:00
你这些文件已经在仓库里了,现在加 ignore 没用了, git rm --cached .next/* 先从仓库删除
darrenfang
2020-06-09 14:17:30 +08:00
.gitignore 里面添加这个就行了

# next.js build output
.next


按照 @Vegetable #5 的方法先把仓库里面的文件删掉。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/679782

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX