S
S
Stanislav Dubrovsky2015-10-29 19:37:57
Web development
Stanislav Dubrovsky, 2015-10-29 19:37:57

WebPack: how to set up including SVG files so that they are collected as inline-SVG?

The task is to manage SVG icons through CSS. Decided to include icons as inline-SVG. I use Jade + Stylus in the project. Now I connect it as follows:
1. Manually copy the contents of icon.svg into a special file for icons icon.jade, removing unnecessary tags and translating the SVG syntax into jade syntax.
2. I include the icon.jade file in index.jade via include
3. I enjoy the lost time :( Of
course, this is a crutch, everything works, but maybe there is a "human" way? I found https://github.com/sairion/svg
from existing solutions -inline-loader
But it didn't work out of the box.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Goncharov, 2015-10-29
@agmegadeth

May be useful: DeSvg

A
alltiptop, 2016-01-14
@alltiptop

You can put a link to the required css at the beginning of the svg file

<?xml-stylesheet href="style.css" type="text/css"?>

M
mrsum, 2016-07-01
@mrsum

Try https://github.com/mrsum/webpack-svgstore-plugin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question