davideast / remix-starter-firebase

30 stars 4 forks source link

Is there any way to test the built version of remix with firebase? #1

Open kentcdodds opened 3 years ago

kentcdodds commented 3 years ago

Like the express starter: https://github.com/remix-run/starter-express/blob/4d5ad819ff69181d3370bacebe3e4b1c49a93088/package.json

I'd like to have a script I can run to test the whole app locally with the built/production version of everything. Is this possible with firebase?

davideast commented 3 years ago

It is definitely possible. I'm not sure how to get it working with Remix however.

I quickly tried adding:

"serve": "cross-env NODE_ENV=production remix build && tsc -b && firebase emulators:start",

But that doesn't do the trick, it fails because it seems to still look for the Remix server (which I think should only work in dev?).

FetchError: request to http://localhost:8002/asset-manifest.json failed, reason: connect ECONNREFUSED 127.0.0.1:8002

@ryanflorence @mjackson any ideas?

kentcdodds commented 3 years ago

I've figured out a good solution in my adjusted setup. The magic is in the remix config: https://github.com/kentcdodds/elaborate/blob/2ee2f3418aa30fc0db99a801fed663191dededfe/remix.config.js#L3-L6