JetBrains / svg-sprite-loader

Webpack loader for creating SVG sprites.
MIT License
2.02k stars 270 forks source link

How to use with rollup? #393

Closed sayjeyhi closed 4 years ago

sayjeyhi commented 4 years ago

Hi there. First of all thanks to this great work. I want to use svg-sprite-loader in rollup to build my icons pack:

import * as react from 'react';
import Symbol from  './index.svg';

const Icon = () =>
   <svg viewBox="${symbol.viewBox}">
       <use xlink:href="#${symbol.id}"></use>
   </svg>;

export default Icon;

But this will run in the rollup environment and I will use the es module with webpack. I want to build my icons pack with rollup then sprite them anywhere I use them with webpack. is it possible?

@kisenka

kisenka commented 4 years ago

@sayjeyhi this is a loader for webpack, not for rollup. Sorry, It's not possible to run it in rollup enviromnent.