Skip to content

Commit 5437db5

Browse files
committed
Fix read-only file system issue
1 parent 7e0b4d6 commit 5437db5

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ If you need to use a custom input or output file, you can run `bundle exec tailw
392392
393393
_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)._
394394
395-
If you have Rails Engines in your application that use Tailwind CSS and provide an `app/assets/tailwind/<engine_name>/engine.css` file, entry point files will be created for each of them in `app/assets/builds/tailwind/<engine_name>.css` so they can be included in your host application's Tailwind CSS by adding `@import "../builds/tailwind/<engine_name>"` to your `app/assets/tailwind/application.css` file.
395+
If you have Rails Engines in your application that use Tailwind CSS and provide an `app/assets/tailwind/<engine_name>/engine.css` file, entry point files will be created for each of them in `app/assets/builds/tailwind/<engine_name>.css` on the first build/watch invocation so they can be included in your host application's Tailwind CSS by adding `@import "../builds/tailwind/<engine_name>"` to your `app/assets/tailwind/application.css` file.
396396
397397
> [!IMPORTANT]
398398
> 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.

lib/tailwindcss/engine.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@ class Engine < ::Rails::Engine
1515
config.app_generators do |g|
1616
g.template_engine :tailwindcss
1717
end
18-
19-
config.after_initialize do
20-
Tailwindcss::Engines.bundle
21-
end
2218
end
2319
end

lib/tasks/build.rake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace :tailwindcss do
44
debug = args.extras.include?("debug")
55
verbose = args.extras.include?("verbose")
66

7+
Tailwindcss::Engines.bundle
78
command = Tailwindcss::Commands.compile_command(debug: debug)
89
env = Tailwindcss::Commands.command_env(verbose: verbose)
910
puts "Running: #{Shellwords.join(command)}" if verbose
@@ -18,6 +19,7 @@ namespace :tailwindcss do
1819
always = args.extras.include?("always")
1920
verbose = args.extras.include?("verbose")
2021

22+
Tailwindcss::Engines.bundle
2123
command = Tailwindcss::Commands.watch_command(always: always, debug: debug, poll: poll)
2224
env = Tailwindcss::Commands.command_env(verbose: verbose)
2325
puts "Running: #{Shellwords.join(command)}" if verbose

0 commit comments

Comments
 (0)