title: Using gulp-svg-sprite with dynamic destination based on source folder
body: <p>this is my use case:</p>
  <p>I have a source folder with icon 'collections' divided in folders, i.e.</p>
  <pre><code>src/
      svg/
          basic/
              icon-1.svg
              icon-2.svg
              ...
          ecommerce/
              icon-1.svg
              icon-2.svg
              ...
          social/
              icon-1.svg
              icon-2.svg
              ...
          ...
  </code></pre>
  <p>Now, I'd like to export all these icons to SVG spritesheets with <a href="https://www.npmjs.com/package/gulp-svg-sprite" rel="nofollow noreferrer">gulp-svg-sprite</a> into this structure:</p>
  <pre><code>dest/
      svg/
          icons-basic.svg
          icons-ecommerce.svg
          icons-social.svg
          ...
  </code></pre>
  <p>Now, I already know how to output a SVG spritesheet with all icons, but I cannot figure out how to pass the <strong>folder</strong> parameter (<code>icons-{folder}.svg</code>) to gulp-svg-sprite.</p>
  <p>This is my current gulp task:</p>
  <pre class="lang-js prettyprint-override"><code>gulp.task( 'build:svg', () =&gt; {
    return gulp.src( path.join( 'src', 'svg', '**/*.svg' ) )
      .pipe( svgmin( { js2svg: { pretty: true } } ) )
      .pipe( svgsprite({
        mode: {
          symbol: {
            dest: '.',
            sprite: 'icons.svg'
          }
        }
      }))
      .pipe( gulp.dest( path.join( 'public', 'assets', 'svg' ) ) );
  });
  </code></pre>
  <p>Anyone knows some way to do this?</p>