A
A
Alexey Nikolaev2016-02-01 22:33:05
Web development
Alexey Nikolaev, 2016-02-01 22:33:05

Is there a plugin for grunt\gulp to replace svg file paths with its contents?

Goodnight.
Is there a plug-in similar in functionality to wiredep to replace the path to an svg file with its content, and \ or base64 data? For example, I write in a template:

<object type="image/svg+xml" data="/path/file.svg" class="logo">
<!-- или так -->
<img src="/path/file.svg" />

And after building the project, the final html will be something like this:
<object type="image/svg+xml" data="data:image/svg+xml;base64,[data]">
<!-- или так -->
<svg>
<!-- svg-данные -->
</svg>

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bromzh, 2016-02-01
@bromzh

https://github.com/ashaffer/gulp-inline
Better yet, get a webpack. There are for it:
https://github.com/sairion/svg-inline-loader and https://github.com/tcoopman/image-webpack-loader

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question