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

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

@firestar300

Description

@firestar300

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 ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions