Open mathiasleroy opened 5 years ago
This is likely because you need to set the Jekyll build environment to production. It defaults to development instead, and as a feature this gem only will run when the environment is set to production.
For my build process, this makes sense. I have a test build script which is for debugging, and doesn't need to spend the extra time minimizing while generating my website. But when I do my production build, I want all of my HTML and JQuery to be minimized. So my build script will set the production environment variable when making the final website, and the development environment all other times.
Hope that helps! See https://jekyllrb.com/docs/configuration/environments/ for details on build environments for Jekyll
@gadgethm I'm running into the same issue despite having JEKYLL_ENV set.
% echo $JEKYLL_ENV
production
My config file is as follows -
url: "http://enes100.umd.edu"
plugins:
- jekyll-sitemap
- jekyll-minifier
jekyll-minifier:
uglifier_args:
harmony: true
Any ideas?
Hmm... Try turning harmony off? On my setup I don't have that setting enabled.
I also use a rakefile to set the build environment, but the command that is sent is essentially the following:
JEKYLL_ENV=production jekyll build
You are also welcome to try my settings and see if that works better for you:
plugins:
- jekyll-minifier
sass:
sass_dir: _sass
style: compressed
jekyll-minifier:
preserve_php: false
remove_spaces_inside_tags: true
remove_multi_spaces: true
remove_comments: true
remove_intertag_spaces: true
remove_quotes: true
compress_css: true
compress_javascript: true
compress_json: true
simple_doctype: true
preserve_line_breaks: false
simple_boolean_attributes: true
compress_js_templates: true
Exact same issue, jekyll 3.8.4.
plugins:
- jekyll-minifier
in _config.yml
gives no result (JEKYLL_ENV=production)
Does anyone know of a workaround?
Same issue.
Having the same issue..
the command i use is the following, it works with the only problem that only includes a single js file and i have 2
JEKYLL_ENV=production bundle exec jekyll build
Doesn't work for me either, I debugged for a couple of hours and then gave up and just used Gulp after build, before deploy.
gulp-minify-inline
achieved exactly what I wanted
Same issue. Doesn't work.
Same issue. Is this project dead?
@gadgethm, I'd appreciate it if you let me know. Is this working for anyone?
Also, does JEKYLL_ENV need to be set to "production" or production? (With the quotations or without?) I've tried both and had no luck so far.
I honestly haven't run this code on my website in ages at this point, I rarely update anymore. I'm afraid I'm probably too out of the loop to be much help.
Given the quick look at the commit history for this project, I would say it seems to be fairly... well, dead tbh. Sounds like the best workaround idea is to use Gulp instead, though I haven't tried this.
If I find some time to take a look, I'll see if I can come up with a forked solution, but honestly at this point it may be better to look for alternatives. Sorry @SamanDaneshvar.
Hey there, a brief update since my last comment for anybody looking... We left Jekyll behind and rebuilt the @lesalonapp site in Hugo, several thousand pages in size, over the course of about 4 weeks last summer. It was really worth it and I now recommend moving to Hugo for anybody having issues with Jekyll
Not working for me either. Using windows, and set JEKYLL_ENV=production
already done
I can't get it to work, I've upgraded the bundler, and I've repeatedly run bundle update or install and reinstalled jekyll-minifier, but it doesn't solve the problem.
不能用+1。
This plugin is not working anymore for me.
No errors, just not minifying
Here is my _config.yml