I need to comment out some lines from the firebase.json
file:
Example:
"rewrites": [
// {
// "source": "/blog/*",
// "function": "handleBlog"
// },
{
"source": "**",
"destination": "/index.html"
}
]
In this case, I want to disable that rewrite
temporarily but I do not want to delete the code.
The fact is that JSON files do not allow comments and I get an error from VSCode telling me that.
But if I set the Language Mode to JSON with Comments
, the errors from VSCode are gone.
But is it safe to do? How does Firebase handle a firebase.json
file with comments?
I've had commented JSON in my one of my firebase.json
s for a while without issue.
{
"hosting": {
"headers": [
/*{
"source": "*.html",
"headers": [
{
"key": "Content-Security-Policy",
"value": "default-src 'self' ..."
}
]
},*/
]
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With