Skip to content

Commit 4a699c5

Browse files
committed
Faster webpack recompilation
1 parent 38acbb0 commit 4a699c5

File tree

6 files changed

+17
-4
lines changed

6 files changed

+17
-4
lines changed

lib/install/stylesheets/application.scss

-3
This file was deleted.

lib/install/stylesheets/base.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import "tailwindcss/base";
2+
3+
// Add custom base styles here
4+
// https://tailwindcss.com/docs/adding-base-styles
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import "tailwindcss/components";
2+
3+
// Import components added to `./components/` here
4+
// https://tailwindcss.com/docs/extracting-components

lib/install/stylesheets/components/.keep

Whitespace-only changes.
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import "tailwindcss/utilities";
2+
3+
// Import vendor CSS here
4+
// https://tailwindcss.com/docs/adding-new-utilities

lib/install/tailwindcss_with_webpacker.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
say "Installing Tailwind CSS"
55
run "yarn add tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9"
6-
insert_into_file "#{Webpacker.config.source_entry_path}/application.js", "\nimport \"stylesheets/application\"\n"
6+
insert_into_file "#{Webpacker.config.source_entry_path}/application.js",
7+
"\n// Imported separately for faster Webpack recompilation. Order matters\""\
8+
"\nimport \"stylesheets/base\""\
9+
"\nimport \"stylesheets/components\""\
10+
"\nimport \"stylesheets/utilities\"\n"
711

812
say "Configuring Tailwind CSS"
913
directory Pathname.new(__dir__).join("stylesheets"), Webpacker.config.source_path.join("stylesheets")

0 commit comments

Comments
 (0)