Skip to content

Commit

Permalink
Split configuration documentation into sections
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillplatonov committed Mar 25, 2024
1 parent 57db695 commit 08e9911
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The gem detects if you use [`jsbundling-rails`](https://github.com/rails/jsbundl

## Configuration

### Listen paths

You can watch for changes in additional folders by adding them to `listen_paths`:
```ruby
# config/environments/development.rb
Expand All @@ -58,6 +60,8 @@ Rails.application.configure do
end
```

### Force reload

If you don't have `data-turbo-track="reload"` attribute on your JS and CSS bundles you might need to setup force reloading. This will trigger full browser reloading for JS and CSS files only:
```ruby
# config/environments/development.rb
Expand All @@ -69,6 +73,8 @@ Rails.application.configure do
end
```

### Reload method

Instead of a direct ActionCable websocket connection, you can reuse the existing TurboStream websocket connection and send updates using standard turbo-streams:
```ruby
# config/environments/development.rb
Expand All @@ -90,6 +96,8 @@ In that case you need to place `hotwire_livereload_tags` helper in your layout *
</head>
```

### Listen options

[Listen gem](https://github.com/guard/listen), which is used for file system monitoring, accepts [options](https://github.com/guard/listen?tab=readme-ov-file#options) like enabling a fallback mechanism called "polling" to detect file changes.

By default, Listen uses a more efficient mechanism called "native" which relies on the operating system's file system events to detect changes. However, in some cases, such as when working with network-mounted file systems or in certain virtualized environments, the native mechanism may not work reliably. In such cases, enabling force_polling ensures that file changes are still detected, albeit with a slightly higher resource usage.
Expand Down

0 comments on commit 08e9911

Please sign in to comment.