README.md in inline_svg-1.4.0 vs README.md in inline_svg-1.5.0
- old
+ new
@@ -4,11 +4,11 @@
Styling a SVG document with CSS for use on the web is most reliably achieved by
[adding classes to the document and
embedding](http://css-tricks.com/using-svg/) it inline in the HTML.
-This gem adds a Rails helper method (`inline_svg`) that reads an SVG document (via Sprockets, so works with the Rails Asset Pipeline), applies a CSS class attribute to the root of the document and
+This gem adds a Rails helper method (`inline_svg`) that reads an SVG document (via Sprockets or Webpacker, so works with the Rails Asset Pipeline), applies a CSS class attribute to the root of the document and
then embeds it into a view.
Inline SVG supports [Rails 3](http://weblog.rubyonrails.org/2010/8/29/rails-3-0-it-s-done/) (from [v0.12.0](https://github.com/jamesmartin/inline_svg/releases/tag/v0.12.0)), [Rails 4](http://weblog.rubyonrails.org/2013/6/25/Rails-4-0-final/) and [Rails 5](http://weblog.rubyonrails.org/2016/6/30/Rails-5-0-final/) (from [v0.10.0](https://github.com/jamesmartin/inline_svg/releases/tag/v0.10.0)).
## Changelog
@@ -298,9 +298,32 @@
is not found:
```ruby
InlineSvg.configure do |config|
config.raise_on_file_not_found = true
+end
+```
+
+## Sprockets and Webpacker
+
+Inline SVG supports SVGs bundled by either Sprockets or Webpacker, however, be
+aware that the gem will *always* attempt to find SVGs using Sprockts if it is
+enabled.
+
+By default, Inline SVG will use Sprockets to find SVG files if it is enabled in
+your Rails project.
+
+If you have upgraded an older Rails project from Sprockets to Webpacker and you
+no longer want to use Sprockets at all, you should disable the Asset Pipeline
+and Inline SVG will use Webpacker automatically.
+
+If you have both Sprockets *and* Webpacker enabled for some reason and you want
+Inline SVG to use Webpacker to find SVGs then you should configure the
+`asset_finder` appropriately:
+
+```ruby
+InlineSvg.configure do |config|
+ config.asset_finder = InlineSvg::WebpackAssetFinder
end
```
## Contributing