You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`assets:precompile` loads the Rails app in production mode and can be slow in Docker/Fly builds.
496
-
RubyCMS now skips non-asset runtime initializers during this phase (navigation registration,
496
+
RubyCMS skips non-asset runtime initializers during this phase (navigation registration,
497
497
dashboard registration, versioning hook, settings import, and permission seeding), which reduces
498
-
precompile overhead.
498
+
precompile overhead. Detection uses `ARGV` (not only `$PROGRAM_NAME`) so it still applies when the
499
+
Ruby program name is `ruby` instead of `rails`.
500
+
501
+
**Tailwind CSS:** Do not add multiple `@source` globs that point at the same RubyCMS gem (e.g. both
502
+
`../../../../gems/ruby_cms/...` and `/usr/local/bundle/.../ruby_cms-*`). That scans the engine twice
503
+
and slows `tailwindcss:build` a lot. Instead, rely on [tailwindcss-rails engine support](https://github.com/rails/tailwindcss-rails#rails-engines-support-experimental):
504
+
505
+
1. RubyCMS ships `app/assets/tailwind/ruby_cms_engine/engine.css` with `@source` paths relative to the gem
506
+
(the directory matches Rails’ `engine_name` for `RubyCms::Engine`, which is `ruby_cms_engine`).
507
+
2.`rails tailwindcss:engines` (run automatically before `tailwindcss:build`) generates
508
+
`app/assets/builds/tailwind/ruby_cms_engine.css` in the host app.
509
+
3. In the host’s `app/assets/tailwind/application.css`, add **once**:
510
+
511
+
```css
512
+
@import"../builds/tailwind/ruby_cms_engine";
513
+
```
514
+
515
+
Place it next to your other `@import` lines (e.g. after `@import "tailwindcss";`). Remove any
516
+
hand-written `@source` lines aimed at the RubyCMS gem.
0 commit comments