Gatsby Cloud --no-uglify - gatsby-cloud

How can I run my Gatsby Cloud project with --no-uglify flag?
So I would like the build to run gatsby build --no-uglify, but I can't find a way to change the build command.

Related

Download or sync Firebase Functions to local environment

I am working on a Firebase project that currently uses several Cloud Functions.
The thing is that I want to download or sync the Cloud Functions to the local environment on my laptop.
I mean some command using firebase-tools or another like:
git clone [project name]
git fetch [something]
Usually, we create some cloud functions using the Firebase Console, and I would like to have these functions locally to edit these when needed and deploy them again.
I know that firebase-tools have these two commands, but it is only for configurations:
functions:config:clone [options]
functions:config:get [options]
There's no provided solution for automatically copying or synchronizing functions that have already been deployed. You can certain get the source code for deployed functions, but the Firebase CLI will not automate that process for you.
Ideally, you will want to manage all of your functions from the same source control and CLI in order to deal with them all consistent. Editing functions from the console is primarily a convenience, not a proper deployment mechanism.

How do you deploy firebase cloud functions to all aliases?

I have cloud functions set up for a project that will be used by multiple projects. I understand that you can deploy those functions to different projects using firebase use and adding/using aliases. Is there a way to deploy the functions to all known project aliases?
There is nothing built in to the Firebase CLI to do this as each project is considered to be a fully separate environment. You can use the --project <alias_or_project_id> flag to deploy to different aliases without having to switch using firebase use:
firebase deploy --project alias1
firebase deploy --project alias2
firebase deploy --project alias3
You could write a shell script to do all of those one after another or in parallel.
The Firebase CLI doesn't have a command for that. You can write a shell script or some other program to automate the execution of firebase deploy as many times as needed for each project you want to deploy.

Firebase deploy after test to production environment

I have created 2 separate projects in Firebase one for the TEST (development) and one for the actual PROD(unction) environment.
I have create a hosting project and am also using Firebase functions that I have successfully deployed and tested on the Firebase TEST project (using the command line as described in the docs).
What is the best / easiest way to now publish to the Firebase PROD project?
Get familiar with the way the Firebase CLI lets you attach a workspace to multiple projects. You can use firebase use --add on the command line to add a project alias, then firebase use [project] to switch between projects for deployment.
You can find the documentation for managing aliases here.

After Firebase deploy - Error: cannot find module

Running a Node.js function in the local Firebase server does not result in the error below, but when I do firebase deploy and try to run the same function on the deployed server I get this error in the Firebase Functions log (in the web Firebase console):
Error: Cannot find module '#google-cloud/speech'
What have I missed? (I can run some other functions on the deployed server, but I am new to this and have no idea if I have done something different, or if there is something different about this npm module.)
Cloud Functions will only install the modules that you've declared as dependencies in your package.json (and their dependencies) in the functions folder. If the module doesn't show up there, you won't be able to access it directly from your code. Be sure to run #google-cloud/speech from your functions folder, so that you can use it both during development an when deployed.

How to update a file that I deployed to Firebase Hosting?

On deploying my app to Firebase, I am getting this message:
You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!
I learnt from a previous post that I need to replace the default index.html with my custom index.html. How do I do that using the Firebase Console?
You cannot change hosted files in the Firebase Console.
Instead, you should change the index.html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.
For small changes it is probably faster to run firebase serve. This spins up a local web server, so that you can test the changes. Once you're satisfied they work, publish them to Firebase Hosting with firebase deploy again.
Update: this is now possible through some custom scripting. See my answer here for details: Upload single file to firebase hosting via CLI or other without deleting existing ones?
Simply make the changes you want to and then type
npm run build
After this spin the server again using
firebase deploy
The changes you want will be updated.
You can also see the updated changes with the command
firebase serve
and then run firebase deploy when you're satisfied.
First of all Update all the coding and assets files in your local system then,
1) Go to the directory in the terminal by typing $ cd {add your directory}
2) Login on your terminal console by typing $ firebase login in the terminal
3) after login write $ firebase deploy
then, go to Hosting Section in your Firebase Console and delete the previously deployed files by deleting the previously added section in {Poject_Name} release history,
like this
enter image description here
Its a simple solution. This message is caused by the index.html file in your public folder being replaced with the index.html file provided by firebase.
All you have to do is navigate to the directory of your web app folder on your terminal and type in
$ rm .firebaserc
then
$ firebase init
after you've completed the firebase initialization, replace the new index.html file with the one inside the public folder and then type
$ firebase deploy

Resources