Skip to content

Commit a20acae

Browse files
committed
Add instructions about precompiling assets to README
Thanks to @brtz for catching this!
1 parent ac664d8 commit a20acae

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ And that's it. With this alone, you should be able to access Mission Control Job
3232

3333
### API-only apps or apps using `vite_rails` and other asset pipelines outside Rails
3434

35-
If you want to use this gem with an [API-only Rails app](https://guides.rubyonrails.org/api_app.html) or an app that's using `vite_ruby`/`vite_rails`, or some other custom asset pipeline different from Sprockets and Propshaft, you need just one more thing: configure an asset pipeline so you can serve the JavaScript and CSS included in this gem. We recommend to use [`Propshaft`](https://github.com/rails/propshaft). You simply need to add this line to your application's Gemfile:
35+
If you want to use this gem with an [API-only Rails app](https://guides.rubyonrails.org/api_app.html) or an app that's using `vite_ruby`/`vite_rails`, or some other custom asset pipeline different from Sprockets and Propshaft, you need one more thing: configure an asset pipeline so you can serve the JavaScript and CSS included in this gem. We recommend to use [`Propshaft`](https://github.com/rails/propshaft). You simply need to add this line to your application's Gemfile:
3636

3737
```ruby
3838
gem "propshaft"
@@ -43,7 +43,16 @@ Then execute
4343
$ bundle install
4444
```
4545

46-
And you should be ready to go.
46+
Then, make sure you add a step to your deployment pipeline to precompile assets:
47+
```
48+
RAILS_ENV=production rails assets:precompile
49+
```
50+
51+
For example, if you're using the Dockerfile generated by Rails with an API-only app or having skipped the assets pipeline, re-add:
52+
```
53+
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
54+
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
55+
```
4756

4857
*Note: Legacy CSS bundlers `sass-rails` and `sassc-rails` may fail to compile some of the CSS vendored into this library from [Bulma](https://github.com/jgthms/bulma), which was created in [Dart SASS](https://sass-lang.com/dart-sass/). You will therefore need to upgrade to `dartsass-rails` or some library that relies on it, like `cssbundling-rails`.*
4958

0 commit comments

Comments
 (0)