Browse Source

Opt for a more effective hack

https://github.com/hexojs/hexo/issues/1663#issuecomment-165710259
Kevin van Zonneveld 9 years ago
parent
commit
c8759af60c
1 changed files with 4 additions and 10 deletions
  1. 4 10
      website/private_modules/hexo-renderer-uppyexamples/index.js

+ 4 - 10
website/private_modules/hexo-renderer-uppyexamples/index.js

@@ -38,18 +38,12 @@ hexo.extend.renderer.register('es6', 'js', function(data, options, callback) {
       }
       hexo.log.i('hexo-renderer-uppyexamples: read: ' + tmpFile);
 
-      callback(null, bundledJS);
-
-      // @TODO REMOVE THIS MASSIVE HACK!
-      // Once this is resolved: https://github.com/hexojs/hexo/issues/1663
-      var finalDest = data.path.replace('/src/', '/public/')
-      finalDest = finalDest.replace('.es6', '.js');
 
-      setTimeout(function(){
-        hexo.log.i('hexo-renderer-uppyexamples: applying hack for: ' + finalDest);
-        fs.writeFileSync(finalDest, bundledJS);
-      }, 1000)
+      // @TODO remove this hack
+      // once this is resolved: https://github.com/hexojs/hexo/issues/1663
+      bundledJS = bundledJS.replace(/</g, ' < ');
 
+      callback(null, bundledJS);
     });
   });
 });