Question: How can I set the input dir of my svg files
See original GitHub issueI tried the native svg-sprite package for npm and I created this script inside my package.json:
"gen-sprite": "svg-sprite --css --css-render-css --css-example --dest=dist app/icons/*.svg",
so everything is fine with it, it goes into my app/icons/
dir and creates a sprite out of all my svg icons.
Now I wanted to use it with webpack and my config looks like this: https://pastebin.com/nwGtGEiv
The problem is that nothing happens when I call my webserver. In all of your examples I see a js file with this inside:
import twitterLogo from './logos/twitter.svg';
but I don’t have such file and I don’t need it. So my question is, what is the option to set a path to the input folder of my svg icons. I tried include, but same result, no sprite.svg at the end.
Regards
Chris
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
With the SVG package, is it possible to set the output folder ...
Is there a way to tell the package to feed Inkscape an output path that matches the input file path? A sample of...
Read more >How to add a SVG icon within an input?
So I have the placeholder with a string which currently just printing that string. I need to put the icons within that I...
Read more >SVGs Made Simple 2: How to Upload SVG Cut Files to Cricut ...
Get the free SVGs Made Simple workbook #2 here: https://jennifermaker.com/svgs-made-simple-workbook-2This is video 2 of the SVGs Made Simple ...
Read more >Adding vector graphics to the web - Learn web development
In this article we'll show you how to include one in your webpage. ... The SVG format allows us to create powerful vector...
Read more >SVG Files: What They Are and How to Make One
Most browsers are designed to render, interpret, and display SVG files. To open a .svg file, launch your browser, then open the file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you need just to create a sprite from set of images put following code somewhere in your app sources:
This will scan icons dir and import every SVG file. In combination with extract mode it will create a separate sprite file.
I use TS and maybe the
@types/webpack-env
module is outdated. When I add@types/webpack-env
via npm i, I got this error:error TS2306: File 'MyProject/node_modules/@types/webpack-env/index.d.ts' is not a module.
But anyway, this is not the problem of this ticket.