Skip to content

Commit c1507ab

Browse files
author
David Heinemeier Hansson
committed
Tasks for previewing the purge work
1 parent 97afbbd commit c1507ab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/tasks/tailwindcss_tasks.rake

+10
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,14 @@ namespace :tailwindcss do
33
task :install do
44
system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../install/tailwindcss.rb", __dir__)}"
55
end
6+
7+
task :keeping_class_names do
8+
puts Tailwindcss::Purger.extract_class_names_from(Rails.root.glob("app/views/**/*.*") + Rails.root.glob("app/helpers/**/*.rb"))
9+
end
10+
11+
task :preview_purge do
12+
puts Tailwindcss::Purger.purge \
13+
Pathname.new(__FILE__).join("../../../app/assets/stylesheets/tailwind.css").read,
14+
keeping_class_names_from_files: Rails.root.glob("app/views/**/*.*") + Rails.root.glob("app/helpers/**/*.rb")
15+
end
616
end

0 commit comments

Comments
 (0)