尝试给cc-plugin加hmr功能,发现因为使用到了这个mini-css-extract-plugin这个插件,这个插件的hmr功能好像对Creator并不是太好使,
function reloadAll() {
// 这里使用了document,还真的和Creator不是太配合
var elements = document.querySelectorAll("link");
forEach.call(elements, function (el) {
if (el.visited === true) {
return;
}
updateCss(el);
});
}
module.exports=function(moduleId, options){
function update(){
reloadAll();
}
}
看来,还真得自己实现一套了。