Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Transformar iconos svg en js

Tengo una biblioteca de íconos SVG (archivos) que necesito colocar en las variables js que luego se pueden importar después de una compilación en otras partes de la aplicación. Este proceso será realizado por un script gulp que debe convertir los svgs. El escenario se puede resumir con el siguiente ejemplo:

Carpetas:

 dist/ |_icons/ src/ |_svgs/ gulpfile.js
 <!-- svgs/MyIcon.svg --> <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="....very long path..." fill="black"/> </svg>
 gulp.task('build-icons', function() { return gulp.src(`src/svgs/*.svg`) .pipe(gulpRename((path) => { //rename svg, not important for the scope })) .pipe(gulpChange(function(content, done) { //here I want to "convert" the svg to a JS file //I'm open to ideas for this part, either use document.create, //or whatever allows me to obtain a SVG that I can then import //and inject using JQuery })) .pipe(gulp.dest('dist/icons/')); });
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!