theme-next / hexo-filter-optimize

A Hexo plugin that optimize the pages loading speed.
MIT License
45 stars 2 forks source link

很棒!但对本地调试不太友好…… #5

Closed reuixiy closed 5 years ago

reuixiy commented 6 years ago

本地hexo s调试时,与没有安装前相比,反应太慢,消耗了太多的 CPU 和内存,不太友好。

能否作为一个单独功能?

比如用一个新的命令hexo optimize,这样每次 deploy 前执行一下hexo optimize即可,不会影响本地调试。

daya0576 commented 6 years ago

me too, any solution??

reuixiy commented 6 years ago

Just modify true to false in _config.yml when you run hexo s, and modify false to true before you plan to deploy it to GitHub Pages. :joy_cat:

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

daya0576 commented 5 years ago

Just modify true to false in _config.yml when you run hexo s, and modify false to true before you plan to deploy it to GitHub Pages. 😹

open_filter_optimize="enable: true # filter_optimize"
close_filter_optimize="enable: false # filter_optimize"
# 开启filter_optimize
sed -i "" "s/$close_filter_optimize/$open_filter_optimize/" _config.yml

hexo g && hexo deploy

# 关闭filter_optimize
sed -i "" "s/$open_filter_optimize/$close_filter_optimize/" _config.yml

wrote a script to solve this problem...

ivan-nginx commented 5 years ago

Guys, how something about development option?

maple3142 commented 5 years ago

What about using NODE_ENV?

daya0576 commented 5 years ago

What about using NODE_ENV?

Maybe an option in config would be better, because in most cases, hexo-filter-optimize is not necessary for local developing.

daya0576 commented 5 years ago

What about using NODE_ENV?

Got ur idea, how can I manually set NODE_ENV locally? export NODE_ENV=developing and check it in code ?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.