Skip to content

Switch css and js bundling to Dart SASS and esbuild #135

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

Merged
merged 3 commits into from
Jan 16, 2025
Merged

Conversation

rahearn
Copy link
Contributor

@rahearn rahearn commented Jan 13, 2025

🎫 Addresses issue: #96

closes #96

🛠 Summary of changes

  • swap out webpack in favor of esbuild
  • swap out postcss in favor of dart-sass
  • switch around i18n-js generator to play nicer with the default esbuild path globbing

both swaps are more performant and require less configuration than their predecessors. In addition, this lets us drop a weird dependency on one of my forks of a long-abandoned project

the template still supports passing --javascript=webpack (since it wasn't really doing anything for that in the first place), but --css=postcss won't work out of the box anymore.

📜 Testing Plan

How would a peer test this work?

  • create a new application
  • verify that bin/rails assets:precompile works properly
  • run bin/rails assets:clobber to get rid of static assets
  • run bin/dev to start the local server and verify site looks proper in browser
  • make changes to application.css and/or application.js and verify that changes are properly reflected on a reload

@rahearn rahearn requested a review from a team January 13, 2025 16:25
@rahearn rahearn mentioned this pull request Jan 13, 2025
Copy link
Contributor

@pauldoomgov pauldoomgov left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@zjrgov zjrgov left a comment

Choose a reason for hiding this comment

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

This is delightfully simple for a (multi) build tool transition.

last 2 versions
IE 11
Copy link
Contributor

Choose a reason for hiding this comment

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

:-)

@rahearn rahearn merged commit a2e934f into main Jan 16, 2025
3 checks passed
@rahearn rahearn deleted the dart-sass branch January 16, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pick new css building solution
3 participants