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

It's not working anymore #48

Open
mathiasleroy opened this issue Jan 21, 2019 · 15 comments
Open

It's not working anymore #48

mathiasleroy opened this issue Jan 21, 2019 · 15 comments

Comments

@mathiasleroy
Copy link

mathiasleroy commented Jan 21, 2019

This plugin is not working anymore for me.

No errors, just not minifying

Here is my _config.yml

title: BoomBoom
permalink: pretty
markdown: kramdown

exclude: [
        'disclaimer.html'
    ]

sass:
    style: :compressed
    
plugins:
    - jekyll-minifier

jekyll-minifier:
  preserve_php: true                # Default: false
  remove_spaces_inside_tags: true   # Default: true
  remove_multi_spaces: true         # Default: true
  remove_comments: true             # Default: true
  remove_intertag_spaces: true      # Default: false
  remove_quotes: false              # Default: false
  compress_css: true                # Default: true
  compress_javascript: true         # Default: true
  simple_doctype: false             # Default: false
  remove_script_attributes: false   # Default: false
  remove_style_attributes: false    # Default: false
  remove_link_attributes: false     # Default: false
  remove_form_attributes: false     # Default: false
  remove_input_attributes: false    # Default: false
  remove_javascript_protocol: true # Default: false
  remove_http_protocol: false       # Default: false
  remove_https_protocol: false      # Default: false
  preserve_line_breaks: false       # Default: false
  simple_boolean_attributes: false  # Default: false
  compress_js_templates: true      # Default: false
@gadgethm
Copy link

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

@ExSidius
Copy link

ExSidius commented Mar 2, 2019

@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?

@gadgethm
Copy link

gadgethm commented Mar 2, 2019

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

@kvokka
Copy link

kvokka commented Jun 15, 2019

Exact same issue, jekyll 3.8.4.

plugins:
    - jekyll-minifier

in _config.yml gives no result (JEKYLL_ENV=production)

@a-haan
Copy link

a-haan commented Jun 17, 2019

Does anyone know of a workaround?

@missdeer
Copy link

Same issue.

@meirroth
Copy link

Having the same issue..

@Lewatoto
Copy link

Lewatoto commented Apr 2, 2020

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

@nabilfreeman
Copy link

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

@ba32107
Copy link

ba32107 commented Nov 27, 2020

Same issue. Doesn't work.

@SamanDaneshvar
Copy link

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.

@gadgethm
Copy link

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.

@nabilfreeman
Copy link

nabilfreeman commented Feb 11, 2021

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

@MolotovCherry
Copy link

Not working for me either. Using windows, and set JEKYLL_ENV=production already done

@note4
Copy link

note4 commented Jun 4, 2024

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。

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