Handlebars template with webpack problems

断了今生、忘了曾经 提交于 2019-12-13 08:09:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!