问题
I'm having a lot of trouble getting Handlebars templates to work with webpack. I feel like I've tried everything I can try and just get errors left and right and don't know what to do or what to try to figure out next and am hoping someone can help me.
I'm trying to use a handlebars template that includes references to header.hbs and footer.hbs but can't seem to get it to work properly no matter what I try. I started out using the template with html-webpack-plugin directly as in the following thread: Html Webpack Plugin - How do you import headers/footer html partials into body template to no avail. They're saying it works for them but it doesn't work for me. It kinda works but images don't make it through. (I was using handlebars-loader).
I tried switching the loader to handlebars-template-loader. Still didn't work
I tried using handlebars-webpack-plugin insteal of html-webpack-plugin and I just get errors even though I'm using the same configuration in the docs. What gives?
What route should I go? Can anyone get webpack to work with a handlebars template that has partial references to header/footer that contains images? If so, what's your setup?
来源:https://stackoverflow.com/questions/42103241/handlebars-template-with-webpack-problems