-
-
Notifications
You must be signed in to change notification settings - Fork 54
Deployment
Antony Budianto edited this page Nov 19, 2017
·
10 revisions
Here are some deployment services you can try:
These tutorials assumed that you've build your app using cra-universal build
- Edit
package.json
, removebuild
, andtest
scripts - and update your npm
start
script tonode build/bundle.js
- Run command
now
inside./dist
- Optional: you might need to remove your sourcemaps for free plan
- Copy
./dist
inside your./functions/
and rename it to./functions/server
- Update your rewrite on
firebase.json
{ "source": "**", "function": "app" }
- Update your
webpack.config.js
module.exports = { // For Firebase function/package bundle entry: './src/app.js', // Initially, it's ./src/index.js
- Update your
index.js
const functions = require('firebase-functions'); // Copy your `dist` into here and rename it into `server` const app = require('./server/build/bundle'); exports.app = functions.https.onRequest(app);
- Add your server dependencies into your function
package.json
- Remove
./build/index.html
(let firebase function serve it) - Deploy using Firebase CLI
firebase deploy
Please give your support by ⭐️ starring ⭐️ this repo, Thank you 🎉 🎉 🎉