You'll need to run three terminals (or bring in a process manager like concurrently/pm2-dev if you like):
Start the Remix development asset server
npm run dev
In a new tab start functions TypeScript compiler:
npm run dev:functions
In a new tab start Firebase emulators:
npm run start
First, build your Remix app for production:
npm run build
Second, build Cloud Functions:
npm run build:functions
Then deploy your Cloud Functions and Hosting (this runs the functions build script as well)
firebase deploy --only hosting,functions:remix