weex 项目中Git忽略文件的配置

在自动构建的weex项目中没有 .gitignore 文件,所以在上传weex项目到Git上时,会将所有的文件都上传上去,例如 node_modules 里面的所有文件

所有我们可以自己在weex项目的根目录下面创建一个.gitignore 文件,里面的文件内容(从Vue-CLI 自动构建的项目中copy过来的):

.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln

之后在从Git上面clone下来的时候,只要执行以下 npm install 就可以了。

原文地址:https://www.cnblogs.com/linququ/p/9324308.html