This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Route | |
name="landing" | |
path="/" | |
getComponent={ | |
(_, cb) => import('./views/LandingPage/LandingPage' /* webpackChunkName: 'landing' */) | |
.then((module) => cb(null, module.default)) | |
.catch((error) => cb(error, null)) | |
} | |
</Route> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const serverRenderedHtml = async (req, res, renderProps) => { | |
const store = configureStore(); | |
//call, wait, and set api responses into redux store's state (ghub.io/redux-connect) | |
await loadOnServer({ ...renderProps, store }); | |
//render the html template | |
const template = html( | |
renderToString( | |
<Provider store={store} key="provider"> | |
<ReduxAsyncConnect {...renderProps} /> | |
</Provider>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entry: { | |
main: './client/index.js', | |
}, | |
output: { | |
path: path.resolve('./build/client'), | |
filename: 'js/[name].[chunkhash:8].js', | |
}, | |
module: { | |
rules: [ | |
{ test: /\.js$/, exclude: /node_modules/, use: ['babel-loader'] }, |
NewerOlder