Skip to content

Commit 6518ec0

Browse files
Hodel Lukas, ENT-BPN-BAN-PDC-SWE-2Hodel Lukas, ENT-BPN-BAN-PDC-SWE-2
Hodel Lukas, ENT-BPN-BAN-PDC-SWE-2
authored and
Hodel Lukas, ENT-BPN-BAN-PDC-SWE-2
committed
Faster webpack compile time
When adding custom css into a separate file webpack does not have to compile the whole tailwindcss again but only the changes in application.scss
1 parent 38acbb0 commit 6518ec0

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed
-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
@import "tailwindcss/base";
2-
@import "tailwindcss/components";
3-
@import "tailwindcss/utilities";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import "tailwindcss/components";
2+
@import "tailwindcss/utilities";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "tailwindcss/base";

lib/install/tailwindcss_with_webpacker.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
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+
"\nimport \"stylesheets/tailwind_before\""\
8+
"\nimport \"stylesheets/application\""\
9+
"\nimport \"stylesheets/tailwind_after\"\n"
710

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

0 commit comments

Comments
 (0)