Skip to content

Commit a4315c1

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 a4315c1

File tree

8 files changed

+19
-4
lines changed

8 files changed

+19
-4
lines changed
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
@import "tailwindcss/base";
2-
@import "tailwindcss/components";
3-
@import "tailwindcss/utilities";

lib/install/stylesheets/base.scss

Lines changed: 4 additions & 0 deletions
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
Lines changed: 4 additions & 0 deletions
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.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import "tailwindcss/components";
2+
@import "tailwindcss/utilities";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "tailwindcss/base";
Lines changed: 4 additions & 0 deletions
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

Lines changed: 4 additions & 1 deletion
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/tailwindcss/before\""\
8+
"\nimport \"stylesheets/application\""\
9+
"\nimport \"stylesheets/tailwindcss/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)