Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a companion PR to rails/jsbundling-rails#167 which was recently merged by @dhh.
Like its companion, this PR adds support for the Bun Javascript bundler. It ensures if you have a
bun.lockbfile in your repo (or if you have bun in your$PATHand do not have ayarn.lockfile) we generate all the files/commands usingbuninstead ofyarn.I've manually tested every single choice (and spot checked a few choices for regressions on the "yarn side) but here's an example of Tailwind on a repo that just ran
jsbundling-railswith the bun option.Installation
☁ test_app [main] ./bin/rails css:install:tailwind Build into app/assets/builds exist app/assets/builds identical app/assets/builds/.keep File unchanged! Either the supplied flag value not found or the content has already been inserted! app/assets/config/manifest.js Stop linking stylesheets automatically gsub app/assets/config/manifest.js File unchanged! Either the supplied flag value not found or the content has already been inserted! .gitignore File unchanged! Either the supplied flag value not found or the content has already been inserted! .gitignore Remove app/assets/stylesheets/application.css so build output can take over remove app/assets/stylesheets/application.css Add stylesheet link tag in application layout File unchanged! Either the supplied flag value not found or the content has already been inserted! app/views/layouts/application.html.erb append Procfile.dev Add bin/dev to start foreman identical bin/dev Install Tailwind (+PostCSS w/ autoprefixer) create tailwind.config.js create app/assets/stylesheets/application.tailwind.css run bun add tailwindcss@latest postcss@latest autoprefixer@latest from "." bun add v1.0.0 (822a00c4) installed tailwindcss@3.3.3 with binaries: - tailwind - tailwindcss installed postcss@8.4.29 installed autoprefixer@10.4.15 with binaries: - autoprefixer 3 packages installed [566.00ms] Add build:css script run bun run build:css from "." $ tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify Rebuilding... Done in 104ms.bin/dev with a change to
application.cssRecompiling Assets