Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster webpack compile time #39

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/install/stylesheets/application.scss

This file was deleted.

4 changes: 4 additions & 0 deletions lib/install/stylesheets/base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "tailwindcss/base";

// Add custom base styles here
// https://tailwindcss.com/docs/adding-base-styles
4 changes: 4 additions & 0 deletions lib/install/stylesheets/components.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "tailwindcss/components";

// Import components added to `./components/` here
// https://tailwindcss.com/docs/extracting-components
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dixpac why do we need the special components folder? There is also no folder to structure the base styles (and I would do this too).

I see two ways here:

  1. Everybody should add the own structure
  2. We give them a structure (CoC). Just to do that, I am not too much experienced with tailwind ;)

Empty file.
4 changes: 4 additions & 0 deletions lib/install/stylesheets/utilities.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "tailwindcss/utilities";

// Import vendor CSS here
// https://tailwindcss.com/docs/adding-new-utilities
6 changes: 5 additions & 1 deletion lib/install/tailwindcss_with_webpacker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

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

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