我正在c 中的buidling node.js绑定

I am buidling node.js bindings in C++ should .gitignore the *.gypi files

本文关键字:node js 绑定 buidling 中的      更新时间:2023-10-16

我有以下node.js project:

.
├── auto.gypi
├── autogypi.json
├── auto-top.gypi
├── binding.gyp
├── build
│------ <Where node-gyp builds>   
├── cpp
│   ├── example.cpp
│   └── example.h
├── index.js
├── node_modules 
|----- <dependencies>
├── package.json
├── package-lock.json
└── structure.txt
305 directories, 1299 files

和i .gitignore node.js项目中常用的以下文件:

node_modules
build

总线,您可以注意到有一些*.gypi文件。如果git add ed进入我的项目,或者应该是.gitignore D?

,它们是否会提供任何用途

如果打开其中一个,您会注意到以下评论:

# Automatically generated file. Edits will be lost.
# Based on: autogypi.json

,您也可以消失,这意味着两件事:

  • 只要您拥有autogypi.json文件,就可以生成这些文件。
  • 需要监视autogypi.json文件以在您的项目版本控制(aka git add中(进行更改。

因此,您应该通过以下输入Inti .gitignore文件 auto.gypiauto-top.gypi文件 git ingore

*.gypi