Skip to content

Deployment

Antony Budianto edited this page Aug 30, 2017 · 10 revisions

Here are some deployment service you can try:

  • Build your app using cra-universal build
  • Remove npm build script
  • and update your npm start script to node build/bundle.js
  • Run command now inside ./dist

https://medium.com/@antonybudianto/server-side-rendering-with-react-and-firebase-functions-cd67fdb2b605

  • Update your rewrite
    {
      "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

Please give your support by ⭐️ starring ⭐️ this repo, Thank you 🎉 🎉 🎉

Clone this wiki locally