Skip to content
This repository has been archived by the owner on Jan 23, 2020. It is now read-only.

Not registering any images/*.svg with asset pipeline #6

Open
PascalPixel opened this issue Jun 18, 2019 · 3 comments
Open

Not registering any images/*.svg with asset pipeline #6

PascalPixel opened this issue Jun 18, 2019 · 3 comments

Comments

@PascalPixel
Copy link

PascalPixel commented Jun 18, 2019

We precompile our assets for production, and none of the svg files for the icons are available in production.

Turn off compilation in development:

# config/environments/development.rb
AppName::Application.configure do
  config.assets.compile = false
end

Run precompilation before starting server:

bundle exec rails assets:precompile

Use an inline svg in haml/erb:

= mdi_svg 'cart'

Result is:

<svg><!-- SVG file not found: 'cart.svg' --></svg>

Do you have any idea why this is happening for us? We followed the install steps, the icon fonts are precompiled and in the public/assets folder, including the svg font, just none of the svg image files.

I also tried setting this:

# config/initializers/assets.rb
Rails.application.configure do
  config.assets.precompile += ['material_design_icons/*']
end

But no luck... thanks for reading

@PascalPixel
Copy link
Author

This is a Rails 5 app with Sprockets 3

@PascalPixel
Copy link
Author

Fixed with this:

# config/initializers/assets.rb
Rails.application.configure do
  config.assets.precompile += ['*.svg']
end

But can not figure out how to scope this to just the engine, config.assets.precompile += ['material_design_icons/*'] does not work.

@barrymieny
Copy link
Owner

@Superpencil I'll have to look into this as I haven't used the project myself in quite some time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants