-
Notifications
You must be signed in to change notification settings - Fork 213
Add SSR how-to #1177
Comments
Vue's pages for reference: Though reading through those (I've not set up SSR myself before, so served as a starting point) makes me wonder how useful a guide we could create, given that is seems like an SSR implementation is always going to be very framework and project specific. As mentioned in #1175 (comment) it also feels like this is something that would be good to have documented in webpack's docs - which we could then link to. |
Component rendering SSR (Vue/React) is indeed very platform/app specific, and I think trying to manage our own guide would be tough. BYO-"traditional"-server-rendering (not sure what else to call it, as SSR typically refers to server-rendering SPAs…) on the other hand is pretty much the same, e.g.: module.exports = {
options: {
// Nest your webpack assets within your web root
output: 'public/build',
},
use: [
['@neutrinojs/web', {
// BYO-HTML
html: false,
// Serve everything from `/build/*`
publicPath: `/${basename(neutrino.options.output)}/`,
devServer: {
proxy: {
// Proxy all requests to your running app
'**': {
target: 'http://localhost:3000',
// Hint to your app if this is a dev-server request or not.
// If not, parse manifest.json and use hashed assets in your templates.
headers: {
Forwarded: 'by=_webpack-dev-server'
}
}
},
},
}]
]
}; |
A react ssr demo based on neutrino |
For disabling the html generation, is simply doing
the recommended way to do that? Or is it better to remove it from the config like here: #168 (comment)? |
@dparker2 you got it. |
No description provided.
The text was updated successfully, but these errors were encountered: