From 04602ef2d3269d975746f2501c547f38321645ae Mon Sep 17 00:00:00 2001 From: BakiVernes Date: Tue, 24 Aug 2021 12:39:33 +0200 Subject: [PATCH] Enable JIT mode --- lib/install/stylesheets/tailwind.config.js | 2 ++ lib/install/tailwindcss.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/install/stylesheets/tailwind.config.js b/lib/install/stylesheets/tailwind.config.js index a3c67cb..4f7ae43 100644 --- a/lib/install/stylesheets/tailwind.config.js +++ b/lib/install/stylesheets/tailwind.config.js @@ -1,9 +1,11 @@ module.exports = { // Purge unused TailwindCSS styles + mode: 'jit', purge: { enabled: ["production"].includes(process.env.NODE_ENV), content: [ './**/*.html.erb', + './**/*.scss', './app/helpers/**/*.rb', './app/javascript/**/*.js', ], diff --git a/lib/install/tailwindcss.rb b/lib/install/tailwindcss.rb index 2afee18..bec9163 100644 --- a/lib/install/tailwindcss.rb +++ b/lib/install/tailwindcss.rb @@ -2,7 +2,7 @@ APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb") say "Installing Tailwind CSS" -run "yarn add tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9" +run "yarn add tailwindcss@latest postcss@latest autoprefixer@latest webpack-dev-server@3.11.2" insert_into_file "#{Webpacker.config.source_entry_path}/application.js", "\nimport \"stylesheets/application\"\n" say "Configuring Tailwind CSS"