mhanberg / jekyll-postcss

A plugin to use PostCSS plugins like Autoprefixer or Tailwind CSS with Jekyll.
MIT License
66 stars 12 forks source link

Documentation: Can Jekyll Server be used? #26

Closed rebelwarrior closed 3 years ago

rebelwarrior commented 3 years ago

Can Jekyll server be used with jekyll-postcss? I can't find any documentation on that and it's not working for me.

mhanberg commented 3 years ago

You should be able to use Jekyll as you normally would bundle exec jekyll serve.

What problem are you having?

rebelwarrior commented 3 years ago

I get this bundle exec jekyll serve --config _config.dev.yml

Configuration file: /Users/david/Code/Elm/demo-tailwind-elm-doc-builder/_config.dev.yml
PostCSS Server listening on port 8124...
rebelwarrior commented 3 years ago

and then it hangs.... does nothing.

mhanberg commented 3 years ago

I think I've been seeing this lately as well.

Not sure what the cause is but restarting it a couple times usually works for me.

Could you share your ruby, node, jekyll, and postcss versions?

rebelwarrior commented 3 years ago

ruby version: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin20] node version: v14.16.1 jekyll version: jekyll (4.2.0) postcss.... 8.2.13

demo-tailwind-elm-doc-builder [main] % npm list postcss
/Users/davidacevedo
└─┬ tailwindcss@2.1.2
  ├─┬ @fullhuman/postcss-purgecss@3.1.3
  │ └─┬ purgecss@3.1.3
  │   └── postcss@8.2.13  deduped
  ├─┬ postcss-functions@3.0.0
  │ └── postcss@6.0.23  extraneous
  └─┬ postcss-js@3.0.3
    └── postcss@8.2.13
rebelwarrior commented 3 years ago

Would this plugin need a call out in the default layout to work?

mhanberg commented 3 years ago

No.

rebelwarrior commented 3 years ago

~~Found the problem. ~~ (Nope: I didn't)

~~if you use a main.scss file it will fail. You have to use a main.css file. This can be clearer in the documentation. Also not sure why this causes the problem. _sass/main.css~~

@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
rebelwarrior commented 3 years ago

Nope nevermind. it's not working again.

rebelwarrior commented 3 years ago

If I keep trying it work sometimes. So it's not a consistent problem one thing I can say is that when it works the postcss server launches after the jekyll one gets going.

demo-tailwind-elm-doc-builder [main●●] % jekyll-dev --trace
Configuration file: /Users/davidacevedo/Code/Elm/demo-tailwind-elm-doc-builder/_config.dev.yml
            Source: /Users/davidacevedo/Code/Elm/demo-tailwind-elm-doc-builder
       Destination: /Users/davidacevedo/Code/Elm/demo-tailwind-elm-doc-builder/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
PostCSS Server listening on port 8124...
       Jekyll Feed: Generating feed for posts
rebelwarrior commented 3 years ago

Suspecting this is a thread issue. It runs fine every time with JRuby.

rebelwarrior commented 3 years ago

runs well under ruby 2.7.3 as well.

Atem18 commented 3 years ago

@rebelwarrior How big is your website ?

rebelwarrior commented 3 years ago

It’s empty at the moment.

Sent from my mobile

On May 5, 2021, at 11:58 AM, Kevin Messer @.***> wrote:

 @rebelwarrior How big is your website ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Atem18 commented 3 years ago

Then maybe do a strace to see where the process hangs. And you speak about JRuby, which platform are you using ?

rebelwarrior commented 3 years ago

I’m on a Mac. But it’s not JRuby that fixes it, it’s the older ruby version. It works under 2.7 MRI as well.

Sent from my mobile

On May 6, 2021, at 6:58 AM, Kevin Messer @.***> wrote:

 Then maybe do a strace to see where the process hangs. And you speak about JRuby, which platform are you using ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Atem18 commented 3 years ago

Ruby 3 is still new, I am not sure how far it is supported.

mhanberg commented 3 years ago

@rebelwarrior I think i fixed this. try updating to 0.4.1 and let me know if you are still having problems