如何让Netlify忽略.gitignore并查看所有文件

huangapple go评论63阅读模式
英文:

How to make netlify ignore gitignore and see all files

问题

I ignored the firebase.js file containing the Firebase data URL with gitignore.

However, as shown in the picture below, netlify showed a message saying that firebase.js could not be found.

To solve this problem, I want to give netlify permission to ignore gitignore and see all files. Could you answer me how?

如何让Netlify忽略.gitignore并查看所有文件

npm run build
Failed to compile
Module not found: Error: Can't resolve './firebase.js' in '/opt/build/repo/src'
英文:

I ignored the firebase.js file containing the Firebase data URL with gitignore.

However, as shown in the picture below, netlify showed a message saying that firebase.js could not be found.
To solve this problem, I want to give netlify permission to ignore gitignore and see all files. Could you answer me how?

如何让Netlify忽略.gitignore并查看所有文件

npm run build
Failed to compile
Module not found: Error: Can't resolve './firebase.js' in '/opt/build/repo/src'

答案1

得分: 2

A typical React .gitignore would not ignore firebase.js, especially considering that file, as shown here, is where you initialize Firebase in our application and create a database reference.

You can check that with:

cd /path/to/local/repository
git check-ignore -v -- src/firebase.js

But even if it is ignored, that should not prevent the npm build to run.

英文:

A typical React .gitignore would not ignore firebase.js, especially considering that file, as shown here, is where you initialize Firebase in our application and create a database reference.

You can check that with:

cd /path/to/local/repository
git check-ignore -v -- src/firebase.js

But even if it is ignored, that should not prevent the npm build to run.

huangapple
  • 本文由 发表于 2023年4月10日 21:33:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/75977584.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定