Skip to content

Commit

Permalink
F #5422: fix SSR
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Lobo <[email protected]>
  • Loading branch information
Jorge Lobo committed Jul 14, 2021
1 parent b0845d1 commit 2e777ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/fireedge/src/server/routes/entrypoints/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ router.get('*', (req, res) => {

// production
if (env && (!env.NODE_ENV || (env.NODE_ENV && env.NODE_ENV !== defaultWebpackMode))) {
const App = require('../../../client/dev/_app.js').default
const sheets = new ServerStyleSheets()
const composeEnhancer = (root && root.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose
const apps = Object.keys(defaultApps)
const parseUrl = req.url.split(/\//gi).filter(sub => sub && sub.length > 0)

Expand All @@ -70,6 +67,10 @@ router.get('*', (req, res) => {
}
})

const App = require(`../../../client/apps/${app}/index.js`).default
const sheets = new ServerStyleSheets()
const composeEnhancer = (root && root.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose

// loadable
const statsFile = path.resolve(__dirname, 'client', app + defaultFileStats)
const extractor = new ChunkExtractor({ statsFile })
Expand Down
2 changes: 1 addition & 1 deletion src/fireedge/webpack.config.prod.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const js = {
* @param {object} {assets, appname}
* @returns {object} webpack config
*/
const bundle = ({ assets = false, name = 'flow' }) => {
const bundle = ({ assets = false, name = 'sunstone' }) => {
const plugins = [
new TimeFixPlugin(),
new webpack.DefinePlugin({
Expand Down

0 comments on commit 2e777ae

Please sign in to comment.