Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Generate output SVG on add/remove input icon file #164

Open
firestar300 opened this issue May 4, 2018 · 1 comment
Open

Generate output SVG on add/remove input icon file #164

firestar300 opened this issue May 4, 2018 · 1 comment

Comments

@firestar300
Copy link

Hi

My Webpack config :

new SvgStore(
      path.resolve(__dirname, './../src/img/icons/*.svg'),
      path.resolve(__dirname, './../dist/assets/icons/'),
      {
        name: 'icons',
        prefix: 'icon-',
        chunk: 'svg',
        svgoOptions: {
          plugins: [
            {
              removeTitle: true,
            },
          ],
        },
      }
    ),

My JS entry file :

  //SVG
  let __svg__ = {
    path: '../img/icons/*.svg', // entry
    name: '../icons/icons.svg', // output
  }
  require('./vendor/svgxhr')(__svg__)

The output SVG sprite rebuild when i update my entry JS file. How can I watch for svg images and when i add/remove SVG images, my sprite rebuild ?

@firestar300 firestar300 changed the title Generate output SVG on add/remove icon file Generate output SVG on add/remove input icon file May 4, 2018
@lgordey
Copy link
Collaborator

lgordey commented May 6, 2018

I'm afraid this will not work now.
But feel free to send a pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants