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

Uglifier issue: Extra configuration is required for Uglifier 3.x to support ES6 in production mode (it is supported in development mode) #2755

Closed
improvethings opened this issue Dec 19, 2020 · 5 comments

Comments

@improvethings
Copy link

Environment

Using minimal-mistakes-jekyll 4.21.0

  • Minimal Mistakes version: 4.21.0
  • Ruby gem or remote theme version: 2.7.6.2
  • Jekyll version: 3.8.7
  • uglifier 4.2.0
  • Operating system: Debian 10 (Buster) on Linux 5.4.0-0.bpo.4-amd64 x86_64

Publishing website to Vercel from github.

Expected behavior

Expecting JEKYLL_ENV=production bundle exec jekyll serve to work.

Steps to reproduce the behavior

$ JEKYLL_ENV=production bundle exec jekyll serve
...
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
jekyll 3.8.7 | Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).

=> const fs = require("fs");
2 const pkg = require("./package.json");
3 const filename = "assets/js/main.min.js";
4 const script = fs.readFileSync(filename);
5 const padStart = str => ("0" + str).slice(-2);
6 const dateObj = new Date();
7 const date = ${dateObj.getFullYear()}-${padStart( 8 dateObj.getMonth() + 1 9 )}-${padStart(dateObj.getDate())};

It seems to be related to this issue.

Other

Should I add jekyll-assets to the Gemfile and then the following to _config.yml:
assets:
external:
uglifier:
harmony: true

@mmistakes
Copy link
Owner

Sounds like a question for jekyll-assets. You shouldn't have to mess with any of the theme's assets (JavaScript or CSS) as they are already minified/uglified/and bundled in the theme.

@improvethings
Copy link
Author

Sounds like a question for jekyll-assets. You shouldn't have to mess with any of the theme's assets (JavaScript or CSS) as they are already minified/uglified/and bundled in the theme.

I've posted it there, thanks! It looks like no one has responded to an issue there since April :(

@improvethings
Copy link
Author

Sorry for my ignorance, but as I've not heard back from jekyll-assets in several days, what is the fastest path to get comments working on my blog in the interim if I assume I won't hear from them for months?

@mmistakes
Copy link
Owner

Not sure. This theme doesn’t use Jekyll-assets so I can’t really help as it appears to be an upstream issue with that gem.

@mmistakes
Copy link
Owner

Closing as this isn’t related to the theme. Looks like an upstream issue with a plug-in you installed.

https://github.com/digitalsparky/jekyll-minifier

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

No branches or pull requests

2 participants