I am using express-handlebars in my express project and I'm trying to figure out how to bundle correctly with Webpack with the goal of maintaining the benefits of server side rendering.
If you could add such example to your examples dir that would much appreciated. However, an explanation will suffice.
Webpack outputs a single bundled js file, and running it express cannot render the 'hbs' templates because it still looks for them in a folder say "public/views", is it possible that everything will live in this bundled js file ?
Currently my workaround is: copy my public folder to dist/ folder, I don't think this is the best approach though.
There are two ways I can think of doing it. Copy the public folder into dist (which you are doing) or change your path to the view to be from the dist folder (e.g. ./public/views -> ../public/views)
Hello,
I am using express-handlebars in my express project and I'm trying to figure out how to bundle correctly with Webpack with the goal of maintaining the benefits of server side rendering.
If you could add such example to your examples dir that would much appreciated. However, an explanation will suffice.
Webpack outputs a single bundled js file, and running it express cannot render the 'hbs' templates because it still looks for them in a folder say "public/views", is it possible that everything will live in this bundled js file ?
Currently my workaround is: copy my public folder to dist/ folder, I don't think this is the best approach though.
Thanks.