diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c11a6f..95fd82a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ # `tailwindcss-rails` Changelog -## v4.3.0.rc1 +## v4.3.0.rc2 ### Improved -* Experimental support for Rails engines. Feedback is welcome at #355. #554 @bopm +* Experimental support for Rails engines. Feedback is welcome at #355. #554, #556 @bopm ## v4.2.3 / 2025-05-02 diff --git a/Gemfile.lock b/Gemfile.lock index 1defe8d..dc9444f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -140,11 +140,11 @@ GEM io-console (~> 0.5) securerandom (0.4.1) stringio (3.1.5) - tailwindcss-ruby (4.1.7) - tailwindcss-ruby (4.1.7-aarch64-linux-gnu) - tailwindcss-ruby (4.1.7-arm64-darwin) - tailwindcss-ruby (4.1.7-x86_64-darwin) - tailwindcss-ruby (4.1.7-x86_64-linux-gnu) + tailwindcss-ruby (4.1.10) + tailwindcss-ruby (4.1.10-aarch64-linux-gnu) + tailwindcss-ruby (4.1.10-arm64-darwin) + tailwindcss-ruby (4.1.10-x86_64-darwin) + tailwindcss-ruby (4.1.10-x86_64-linux-gnu) thor (1.3.2) timeout (0.4.3) tzinfo (2.0.6) diff --git a/README.md b/README.md index 274fae8..450a177 100644 --- a/README.md +++ b/README.md @@ -392,7 +392,7 @@ If you need to use a custom input or output file, you can run `bundle exec tailw _This feature is experimental and may change in the future. If you have feedback, please join the [discussion](https://github.com/rails/tailwindcss-rails/discussions/355)._ -If you have Rails Engines in your application that use Tailwind CSS and provide an `app/assets/tailwind//engine.css` file, entry point files will be created for each of them in `app/assets/builds/tailwind/.css` so they can be included in your host application's Tailwind CSS by adding `@import "../builds/tailwind/"` to your `app/assets/tailwind/application.css` file. +If you have Rails Engines in your application that use Tailwind CSS and provide an `app/assets/tailwind//engine.css` file, entry point files will be created for each of them in `app/assets/builds/tailwind/.css` on the first build/watch invocation or manual call for `rails tailwindcss:engines` so they can be included in your host application's Tailwind CSS by adding `@import "../builds/tailwind/"` to your `app/assets/tailwind/application.css` file. > [!IMPORTANT] > You must `@import` the engine CSS files in your `app/assets/tailwind/application.css` for the engine to be included in the build. By default, no engine CSS files are imported, and you must opt-in to using the file in your build. diff --git a/lib/tailwindcss/engine.rb b/lib/tailwindcss/engine.rb index 001004f..7b88c5f 100644 --- a/lib/tailwindcss/engine.rb +++ b/lib/tailwindcss/engine.rb @@ -15,9 +15,5 @@ class Engine < ::Rails::Engine config.app_generators do |g| g.template_engine :tailwindcss end - - config.after_initialize do - Tailwindcss::Engines.bundle - end end end diff --git a/lib/tailwindcss/version.rb b/lib/tailwindcss/version.rb index b4acf0d..d1d65d1 100644 --- a/lib/tailwindcss/version.rb +++ b/lib/tailwindcss/version.rb @@ -1,3 +1,3 @@ module Tailwindcss - VERSION = "4.3.0.rc1" + VERSION = "4.3.0.rc2" end diff --git a/lib/tasks/build.rake b/lib/tasks/build.rake index 603c805..d176f2c 100644 --- a/lib/tasks/build.rake +++ b/lib/tasks/build.rake @@ -1,6 +1,6 @@ namespace :tailwindcss do desc "Build your Tailwind CSS" - task build: :environment do |_, args| + task build: [:environment, :engines] do |_, args| debug = args.extras.include?("debug") verbose = args.extras.include?("verbose") @@ -12,7 +12,7 @@ namespace :tailwindcss do end desc "Watch and build your Tailwind CSS on file changes" - task watch: :environment do |_, args| + task watch: [:environment, :engines] do |_, args| debug = args.extras.include?("debug") poll = args.extras.include?("poll") always = args.extras.include?("always") @@ -26,6 +26,11 @@ namespace :tailwindcss do rescue Interrupt puts "Received interrupt, exiting tailwindcss:watch" if args.extras.include?("verbose") end + + desc "Create Tailwind CSS entry point files for Rails Engines" + task engines: :environment do + Tailwindcss::Engines.bundle + end end Rake::Task["assets:precompile"].enhance(["tailwindcss:build"])