diff --git a/config-overrides.js b/config-overrides.js index 25b37cb200..a395cc2c20 100644 --- a/config-overrides.js +++ b/config-overrides.js @@ -88,7 +88,7 @@ module.exports = function override(config, env) { config.plugins.push( new webpack.optimize.CommonsChunkPlugin({ names: ['bootstrap'], - filename: './static/js/[name].js', + filename: 'static/js/[name].js', minChunks: Infinity, }) ); diff --git a/hyperion/index.js b/hyperion/index.js index 438532e565..2e7d78f1a4 100644 --- a/hyperion/index.js +++ b/hyperion/index.js @@ -146,6 +146,14 @@ if (process.env.NODE_ENV === 'development') { ); } +app.get('*', (req: express$Request, res, next) => { + // Electron requests should only be client-side rendered + if (req.headers['user-agent'].indexOf('Electron') > -1) { + return res.sendFile(path.resolve(__dirname, '../build/index.html')); + } + next(); +}); + import cache from './cache'; app.use(cache);