This blog is part of our Rails 6.1 series.
rails new my_app creates a new Rails application fully loaded with all the features.
If we want to omit some of the features then we needed to skip them like this.
1# before Rails 6.1 2 3$ rails new tiny_app 4 --skip-action-cable 5 --skip-action-mailer 6 --skip-action-mailbox 7 --skip-action-text 8 --skip-active-storage 9 --skip-bootsnap 10 --skip-javascript 11 --skip-spring 12 --skip-system-test 13 --skip-webpack-install 14 --skip-turbolinks 15
Before Rails 6.1 it was not possible to skip things like active_job and jbuilder.
Rails 6.1
Rails 6.1 added a new option --minimal.
1 2$ rails new tiny_app --minimal 3
All the following are excluded from this minimal Rails application.
- action_cable
- action_mailbox
- action_mailer
- action_text
- active_job
- active_storage
- bootsnap
- jbuilder
- spring
- system_tests
- turbolinks
- webpack
We can bundle webpack in this minimal app like this.
1 2$ rails new tiny_app --minimal webpack=react 3
Database option can also be passed.
1 2$ rails new tiny_app --minimal --database postgresql webpack=react 3
Check out the pull request for more details on this.