platanus / potassium

A Rails application generator by Platanus, inspired by Suspenders
MIT License
232 stars 17 forks source link

feat/tailwind 2 compat build #356

Closed iaacosta closed 3 years ago

iaacosta commented 3 years ago

Context

TailwindCSS 2 is compatible with PostCSS 8, but Webpack 4 enforces PostCSS 7, which breaks the generated project if the user does not explicitly specify a lower version of Tailwind (e.g. 1.9.2) or fixes this issue.

Changes

Uses the special Tailwind 2 tailwindcss@npm:@tailwindcss/postcss7-compat package version that is compatible with postcss@^7 in generated projects. This change should not be needed anymore when @rails/webpacker@^6 is released and upgraded in Potassium.

Both postcss@^7 and autoprefixer@^9 aren't strictly needed as dependencies because they are also dependencies of @rails/webpacker@4.3.0 and are installed anyways. Nevertheless, I'd rather explicitly specify the dependencies of this compatibility build.

Changes might conflict with the ones done in #350 relative to TailwindCSS version.

Closes #349