I have build a react app and I used firebase hosting to deploy my app. It's working fine but firebase has hosted all the source code. I only need to upload build folder. How can I remove other files from the hosting?
firebase.json
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Is there any thing to do?
But somehow I have uploaded build folder only for another app But I cannot remember/find how I did it, I see no different between firebase.json
firebase,json
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
We have map files in build/static
folder. Those files will re-generate the source files. So we can re-deploy the website after deleting .map
files or change the firebase.json
file.
{
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**", "**/**/*.map"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}