1

这是完整的错误:

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
...
4

2 回答 2

0

试试这个_config.ymlhttps ://github.com/dart-lang/site-www/issues/502#issuecomment-365955221

  assets:
    ...
    external:
      uglifier:
        harmony: true
于 2019-08-26T07:52:26.453 回答
-1

摆脱 Uglifier。它不支持 ES6,或者至少它不支持 Rails 附带的配置。

于 2019-08-20T18:02:26.503 回答