File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
APPLICATION_LAYOUT_PATH = Rails . root . join ( "app/views/layouts/application.html.erb" )
2
2
CENTERING_CONTAINER_INSERTION_POINT = /^\s *<%= yield %>/ . freeze
3
+ DEVELOPMENT_ENVIRONMENT_CONFIG_PATH = Rails . root . join ( "config/environments/development.rb" )
3
4
4
5
if APPLICATION_LAYOUT_PATH . exist?
5
6
say "Add Tailwindcss include tags and container element in application layout"
16
17
say %( Add <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> within the <head> tag in your custom layout.)
17
18
end
18
19
20
+ if DEVELOPMENT_ENVIRONMENT_CONFIG_PATH . exists?
21
+ say "Enable Tailwindcss server process in development"
22
+ insert_into_file DEVELOPMENT_ENVIRONMENT_CONFIG_PATH . to_s , <<~ERB . indent ( 2 ) , before : /^end$/
23
+ # Automatically watch and build Tailwindcss when 'rails server' is started.
24
+ config.tailwindcss.server_process = true
25
+ ERB
26
+ end
27
+
19
28
say "Build into app/assets/builds"
20
29
empty_directory "app/assets/builds"
21
30
keep_file "app/assets/builds"
Original file line number Diff line number Diff line change 3
3
module Tailwindcss
4
4
class Engine < ::Rails ::Engine
5
5
config . tailwindcss = ActiveSupport ::OrderedOptions . new
6
- config . tailwindcss . server_process = Rails . env . development?
6
+ config . tailwindcss . server_process = false # Rails.env.development?
7
7
8
8
initializer "tailwindcss.assets" do
9
9
Rails . application . config . assets . precompile += %w( inter-font.css )
You can’t perform that action at this time.
0 commit comments