hot module reload : yoyo webpack
SilentCicero opened this issue · comments
Anyone have any ideas about adding hot module reload for yoyo template objects?
My current incomplete code:
// ./yoyo-hot-loader.js
module.exports = function(source) {
if ((source.indexOf('yo`') > -1 || source.indexOf("yo-yo") > -1) && source.indexOf("module.hot") === -1) {
source += "if(module.hot) {";
source += " module.hot.accept();";
source += "}";
return source;
}
return null;
}
I'm not to familiar with the webpack hot reload plugin. Currently, this does hot reload but does not remove the old code. Ideas?
Here is the API: https://webpack.github.io/docs/hot-module-replacement.html
cc/ @shama - I reckon you might be the bestest person of us all to solve this, hah ✨ - I have no idea how to webpack
@yoshuawuyts lolol. Oh god. Well it is a mess of a system, but powerful.
Really like yoyo, want to build with it. I have big plans for these little modules. And sheet-router is awesome =D
This seems of use as well @shama https://github.com/just-boris/handlebars-hot-loader - fairly simple
Also, this helps too: https://github.com/yargalot/Angular-HMR
I haven't used yo-yo
or bel
with webpack yet but it should just work. When I get some time I'll play around with it a bit.