Skip to content

Commit 9941df2

Browse files
andresgutgondhh
andauthored
Add javascript folder to be purged by default (#80)
* Add javascript folder to be purged by default * Update compressor.rb Co-authored-by: David Heinemeier Hansson <david@basecamp.com>
1 parent de2c073 commit 9941df2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/tailwindcss/compressor.rb

+9-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def self.call(input)
1010
end
1111

1212
def initialize(options = {})
13-
@options = {
14-
files_with_class_names: Rails.root.glob("app/views/**/*.*") + Rails.root.glob("app/helpers/**/*.rb"),
13+
@options = {
14+
files_with_class_names: files_with_class_names,
1515
only_purge: %w[ tailwind ]
1616
}.merge(options).freeze
1717
end
@@ -23,4 +23,11 @@ def call(input)
2323
input[:data]
2424
end
2525
end
26+
27+
private
28+
def files_with_class_names
29+
Rails.root.glob("app/views/**/*.*") +
30+
Rails.root.glob("app/helpers/**/*.rb") +
31+
Rails.root.glob("app/javascript/**/*.js")
32+
end
2633
end

0 commit comments

Comments
 (0)