handlebars-webpack-plugin
handlebars-webpack-plugin copied to clipboard
Usage with webpack-dev-server
Im not sure where to put this, but a days extensive searching has not yielded any results.
As per the source of this plugin, it would appear that you can use it with webpack-dev-server. I hope that means you can get the .hbs files listed in "entry" watched and compiled as they are edited. However, there seems to be zero documentation about how to do this.
The best thing I have been able to come up with is a bastard that looked something like this:
{ test: /\.hbs$/, loader: HandlebarsPlugin.compileEntryFile(source,output) }
That, atleast created output from the file passed as source. But the partials was never rerendered. The JSON files didnt trigger anything either.
Other options like handlebars-loader and handlebars-template-loader does not seem to provide the features I need.
So - whats the state of this plugin? Is it possible to use with webpack-dev-server or am I completely out of luck.
Ps. Im also very confused about the plugin taking an entry file GLOB where webpack usually only take paths.
Hope someone can help.
Hi mortenfischer.
This plugin, handlebars-webpack-plugin does support webpack-dev-server.
You can follow the example in the Readme. You have a webpack-configuration and this plugins instance has to be passed to the plugins-list, not used as a loader.
If you are looking for a handlebars-loader. Try the following repository: https://github.com/sueddeutsche/handlebars-render-loader
I hope this helps.
It looks like this plugin may not be in active development anymore but definitely +1 on this feature request