cssbundling-rails icon indicating copy to clipboard operation
cssbundling-rails copied to clipboard

Remove yarn from bun detect tool

Open r3cha opened this issue 1 year ago • 1 comments

This PR as result of review and discussion here https://github.com/rails/cssbundling-rails/pull/165

r3cha avatar Mar 12 '25 09:03 r3cha

Yup. Without this change a default rails app will break on Render.

justinko avatar Mar 26 '25 01:03 justinko

Our SASS provider pre-installs bun by default while we are using yarn in development.

For years, we commited and pushed package.json and yarn.lock and some commands depends on yarn :

  "scripts": {
    "build:css:application": "postcss ./app/assets/stylesheets/application.postcss.css -o ./app/assets/builds/application.css",
    "build:css:mailer": "postcss ./app/assets/stylesheets/mailer.postcss.css -o ./app/assets/builds/mailer.css",
    "build:css": "yarn build:css:application && yarn build:css:mailer",

Yet In production, cssbundling-rails decided to use bun over yarn to call build:css and it wasn't a problem so far.

But yesterday they upgraded bun to 1.2.20. It includes this change : https://bun.sh/blog/bun-v1.2.20#automatic-yarn-lock-migration

Now calling bun build:css failed because it cannot found postcss command. We worked around by overriding rake tasks from cssbundling-rails to force them to use yarn until the release of this patch.

inkstak avatar Aug 13 '25 13:08 inkstak

I just switched to Bun ... goodbye esbuild and node.

justinko avatar Aug 13 '25 13:08 justinko