Skip to content

Commit e061000

Browse files
mattrasbanddhh
andauthored
Fixes a couple minor issues with bootstrap: (#160)
1. The `bootstrap.min.js` doesn't include all the dependencies, and consequently does not work out of the box. Adding `@popperjs/core` isn't straightforward. 1. The asset path to the bootstrap/dist/js directory is added twice. While it does not seem to negatively impact things - it's cleaner to ensure it's done once. Co-authored-by: David Heinemeier Hansson <[email protected]>
1 parent f408313 commit e061000

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: Gemfile.lock

+1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ PLATFORMS
199199
arm64-darwin-20
200200
arm64-darwin-21
201201
arm64-darwin-22
202+
arm64-darwin-23
202203
arm64-darwin-24
203204
x86_64-darwin-20
204205
x86_64-darwin-21

Diff for: lib/install/bootstrap/install.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323

2424
if Rails.root.join("config/importmap.rb").exist?
2525
say "Pin Bootstrap"
26-
append_to_file "config/importmap.rb", %(pin "bootstrap", to: "bootstrap.min.js"\n)
26+
append_to_file "config/importmap.rb", %(pin "bootstrap", to: "bootstrap.bundle.min.js"\n)
2727

28-
inject_into_file "config/initializers/assets.rb", after: /.*Rails.application.config.assets.paths.*\n/ do
28+
inject_into_file "config/initializers/assets.rb", after: /.*\/bootstrap-icons\/font.*\n/ do
2929
<<~RUBY
3030
Rails.application.config.assets.paths << Rails.root.join("node_modules/bootstrap/dist/js")
3131
RUBY
3232
end
3333

34-
append_to_file "config/initializers/assets.rb", %(Rails.application.config.assets.precompile << "bootstrap.min.js")
34+
append_to_file "config/initializers/assets.rb", %(Rails.application.config.assets.precompile << "bootstrap.bundle.min.js")
3535
end
3636

3737
add_package_json_script("build:css:compile", "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules")

0 commit comments

Comments
 (0)