Closed empeje closed 5 years ago
I use your template @jedireza in the example folder.
I found that using babel when we precompiled the asset, it uses js
extension while in development using babel-node
I can use jsx
.
So I endup using this code for workaround
await hapi.views({
engines: {
[FAMEWEKA_ENV === 'production' ? 'js' : 'jsx']: HapiReactViews
},
relativeTo: __dirname,
path: 'views',
compileOptions: {
renderMethod: 'renderToString',
layoutPath: path.join(__dirname, 'views'),
layout: 'BaseLayout'
}
});
Nice. Thanks for sharing your learnings Configuring the view engine with the extensions it needs to be compatible with makes sense.
Please add some more detail of the issue you're experiencing and provide a minimal code example demonstrating what what's not working.