main.js 490 B

12345678910111213141516171819202122232425
  1. import symbol from '../assets/twitter.svg';
  2. // Import sprite instance which already contains twitter logo required above
  3. import sprite from 'svg-sprite-loader/runtime/sprite.build';
  4. // Render sprite
  5. const spriteContent = sprite.stringify();
  6. const pageContent = `
  7. <!DOCTYPE html>
  8. <html lang="en">
  9. <head>
  10. <meta charset="UTF-8">
  11. </head>
  12. <body>
  13. ${spriteContent}
  14. <svg viewBox="${symbol.viewBox}">
  15. <use xlink:href="#${symbol.id}"></use>
  16. </svg>
  17. </body>
  18. </html>
  19. `;
  20. console.log(pageContent);