jerryc127 / hexo-theme-butterfly

🦋 A Hexo Theme: Butterfly
https://butterfly.js.org
Apache License 2.0
7.21k stars 1.29k forks source link

开启双评论, 压缩Js后Waline不显示. #645

Closed Hime-Hina closed 3 years ago

Hime-Hina commented 3 years ago

I want to create a Bug report

Butterfly Information

Butterfly Version: 4.0.0-b4

Platform: Windows

Browser: FireFox

Expected behavior

开启双评论后, 使用gulp压缩网站, 切换评论, Waline显示正常.

Actual behavior

实际上, Waline在切换到Twikoo(或者其他评论?)后, 再切换回来就消失了, Twikoo正常.

Steps to reproduce the behavior

  1. 开启双评论(Waline 和 Twikoo, Waline默认)
  2. 使用官方文档的gulpfile.js, 用gulp压缩网站(压缩 Js 使用的是terser, 不过uglify也一样).
  3. 开始Waline显示正常.
  4. 切换到Twikoo.
  5. 再切换回Waline, Waline消失.

实际上, 在切换到Twikoo时, Waline相关html代码就消失了. 若Twikoo作为默认评论系统, 切换到Waline也不会显示. 不开启压缩就不会出现上述问题.

Screenshots

hpSSl4.md.png hpSEtK.md.png hpSepD.md.png

Website

示例网站

Describe the bug

jerryc127 commented 3 years ago

(压缩 Js 使用的是terser, 不过uglify也一样) waline 的 js 用 内联js 引入 terser 和 uglify 并不会压缩 你压缩html 有哪个?

jerryc127 commented 3 years ago

测试 正常

image

Hime-Hina commented 3 years ago

(压缩 Js 使用的是terser, 不过uglify也一样) waline 的 js 用 内联js 引入 terser 和 uglify 并不会压缩 你压缩html 有哪个?

压缩html的是gulp-html-minifier-terser和gulp-htmlclean. 我尝试修改gulp-html-minifier-terser的参数minifyJS为false,的确能解决问题。但有没有办法压缩页面js也能正常显示。

jerryc127 commented 3 years ago

https://github.com/jerryc127/butterfly.js.org/blob/main/gulpfile.js

我用这个 测试正常

Hime-Hina commented 3 years ago

https://github.com/jerryc127/butterfly.js.org/blob/main/gulpfile.js

我用这个 测试正常

我试了下, 好像开启minifyJS就不行..

jerryc127 commented 3 years ago

@Hime-Hina 那我不清楚了 你或者推送上去 我看看

Hime-Hina commented 3 years ago

@Hime-Hina 那我不清楚了 你或者推送上去 我看看

博客

jerryc127 commented 3 years ago

@Hime-Hina 发一下你 waline 的 配置

Hime-Hina commented 3 years ago

@Hime-Hina 发一下你 waline 的 配置

# waline - A simple comment system with backend support fork from Valine
# https://waline.js.org/
waline:
  serverURL: 'https://waline-hime-hina.vercel.app'  # Waline server address url
  avatar: retro # gravatar style https://zh-tw.gravatar.com/site/implement/images/#default-image
  avatarCDN: 'https://cdn.v2ex.com/gravatar/' # Gravatar CDN baseURL
  bg: # waline background
  visitor: true
  option:
    emoji:
      - 'https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/tw-emoji'
      - 'https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/tieba'
      - 'https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/qq'
      - 'https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili'
      - 'https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/alus'
jerryc127 commented 3 years ago

https://test.immyw.com/messageboard/#post-comment

用了你的配置

測試了 正常

Hime-Hina commented 3 years ago

https://test.immyw.com/messageboard/#post-comment

用了你的配置

測試了 正常

啊这, 我还是把压缩页面js关了好了.

stale[bot] commented 3 years ago

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