question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The svg is not outputted when using context

See original GitHub issue

Maybe I’m doing something wrong, but:

Having my webpack config:

      {
        test: /img\/sprite\/.+\.svg$/,
        loader: 'svg-sprite'
      }

It will work, for a single file:

require('../img/sprite/icon-help.svg')

But I can’t get it to work with context, trying this way:

var files = require.context('../img/sprite', true, /.svg$/)

The svg isn’t added to the body of the page.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kisenkacommented, Oct 22, 2016

This code should be placed in your application

0reactions
gohilumeshcommented, Jan 5, 2017

Solve the above problem by installing “@types/webpack”: “^2.1.0”, “@types/webpack-env”: “^1.13.0”,

Read more comments on GitHub >

github_iconTop Results From Across the Web

file_get_contents not outputting svg - php - Stack Overflow
I recollect seeing that some servers are not configured to allow file_get_contents (or readfile with URLs) so I would check investigate this ...
Read more >
Why text in exported SVG images may not display correctly
Simple explanation : The exported SVG is only designed to be displayed in web pages, we didn't design the output to be editable...
Read more >
How would I set the background color of an output SVG? #45
The code I'm using to test this is: ... That's right, there is no 'background' in SVG container - it's always transparent.
Read more >
Using SVG | CSS-Tricks
SVG is an image format for vector graphics. It literally means Scalable Vector Graphics. Basically, what you work with in Adobe Illustrator.
Read more >
Positions - SVG: Scalable Vector Graphics - MDN Web Docs
In this article, we examine how Scalable Vector Graphics (SVG) represents the positions and sizes of objects within a drawing context, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found