svg-sprite / gulp-svg-sprite

SVG sprites & stacks galore — Gulp plugin wrapping around svg-sprite that reads in a bunch of SVG files, optimizes them and creates SVG sprites and CSS resources in various flavours
MIT License
648 stars 43 forks source link

Is it possible to generate JS file? #106

Closed guoyunhe closed 2 years ago

guoyunhe commented 4 years ago

In my project, I want to load SVG sprite in JS:

// sprite.js
module.exports = `<svg>...</svg>`;

Is it possible to add this feature?

Thanks!

ZhangChengLin commented 4 years ago

What is the use of this? Is it practical?

XhmikosR commented 2 years ago

You could use Node fs to read the file and use it as string.