Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexo butterfly主题使用gulp压缩和pjax后异常,已解决记录下来 #184

Closed
kuole-o opened this issue Jan 25, 2022 · 3 comments
Closed

Comments

@kuole-o
Copy link

kuole-o commented Jan 25, 2022

目前问题已解决,记录在这里,也许会帮助到某个陌生人。

使用了gulp-uglify 压缩js,会出现问题。(表现是:出现输入密码页面,但是无论正确还是错误,回车都无响应)报错Uncaught ReferenceError: regeneratorRuntime is not defined

**解决方法:**在gulpfile.js文件中,不压缩hbe.js即可。

//minify js babel
gulp.task('compress', () =>
  gulp.src(['./public/**/*.js', '!./public/**/*.min.js'**, '!./public/lib/hbe.js'**])
		.pipe(babel({
			presets: ['@babel/preset-env']
		}))
    .pipe(uglify().on('error', function(e){
      console.log(e);
    }))
		.pipe(gulp.dest('./public'))
);

使用pjax,页面里一些图片解锁会不加载

**解决方法:**在配置文件里,把那个页面加到pjax排除列表里就行

# Pjax 缓存功能
# 它可能包含错误且不稳定,请在发现错误时提供反馈。
# https://github.com/MoOx/pjax
pjax:
  enable: true
  exclude:
      - /xxxx/
@D0n9X1n
Copy link
Owner

D0n9X1n commented Jan 25, 2022

Nice job!

@D0n9X1n D0n9X1n closed this as completed Jan 25, 2022
@D0n9X1n
Copy link
Owner

D0n9X1n commented Jan 25, 2022

Pinned on top.

@D0n9X1n D0n9X1n pinned this issue Jan 25, 2022
@ghost
Copy link

ghost commented Feb 8, 2022

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants