Do you need Assembly node.js app for server-side rendering?

You need to do ssr to react spa
There is the idea to make a separate bundle
The basis is koa.js
Collect via webpack

config like this
{
 entry: './ssr/src/index.js',
 output: {
 path: __dirname + '/ssr/app',
 filename: 'index.js'
},
 node: {
 fs: 'empty',
 net: 'empty'
},
 module: {
 loaders: [
{
 test: /.the jsx?$/,
 loader: 'babel-loader',
 exclude: /node_modules/,
 options: {
 presets: ["react"]
}
}
]
}
}


But when I run it complains TypeError: Cannot read property '@@any-promise/REGISTRATION' of undefined
undefined is the result of calling window, which is not in node.js (and the site was polyfill for the promise), Although it was not necessary absolutely
June 10th 19 at 16:03
2 answers
June 10th 19 at 16:05
Collect webparam backend? Why?)
Usually the front write on such a bleeding edge es6/es7/jsx, etc., the node is still not understood. - annie_Pagac commented on June 10th 19 at 16:08
June 10th 19 at 16:07
Webpac not needed, do it through babel, he has the file .there babelrc let down all the settings including the jsx support.
and to prod all the same the Assembly to do or all the node_modules in addition to the source code? - annie_Pagac commented on June 10th 19 at 16:10

Find more questions by tags Server-Side RenderingReactNode.js