Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exphbs + webpack bundling #265

Open
borispov opened this issue Oct 18, 2019 · 1 comment
Open

exphbs + webpack bundling #265

borispov opened this issue Oct 18, 2019 · 1 comment

Comments

@borispov
Copy link

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.

@UziTech
Copy link

UziTech commented Oct 18, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants