这是完整的错误:
Liquid Exception: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true). in /_layouts/base.html
我在网上发现解决方案应该是使用:
Uglifier.compile(js, harmony: true)
在一个production.rb
文件中,因为我使用的是 Jekyll,所以我没有该文件,我可以设置的只是config.yml
:
...
assets:
js_compressor: uglifier
...