Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Webpacker #96

Merged
merged 3 commits into from
Jun 16, 2019
Merged

Support Webpacker #96

merged 3 commits into from
Jun 16, 2019

Conversation

jamesmartin
Copy link
Owner

@jamesmartin jamesmartin commented Jun 16, 2019

Raised in #95 and #91. inline_svg currently relies either on Sprockets or a naive static asset finder that just looks for assets in the configured assets directory.

This branch enables the gem to be automatically configured with a new kind of asset finder, WebpackAssetFinder, which uses the Webpacker gem to locate the SVGs on disk.

Note: To make this work automatically it's necessary to completely disable Sprockets in your Rails app. If you can't do that for some reason, then manually configure the WebpackAssetFinder like so:

InlineSvg.configure do |config|
  config.asset_finder = InlineSvg::WebpackAssetFinder
end

@jamesmartin
Copy link
Owner Author

I found the following things helpful when making this work:

@jamesmartin jamesmartin merged commit 545d3c6 into master Jun 16, 2019
@jamesmartin jamesmartin deleted the webpacker-support branch June 16, 2019 21:21
@jamesmartin
Copy link
Owner Author

Released in v1.5.0

@jamesmartin jamesmartin added this to the v1.5.0 milestone Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant