svgstore-webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-beta.3 • Public • Published

Info

A webpack plugin that uses svgstore package to store specified svg images as symbols and makes them available for injection in html-webpack-plugin as htmlWebpackPlugin.files.svgstore

Reasoning / Alternatives

This plugin aims to do what gulp-svgstore and grunt-svgstore does. There are other webpack plugins that handle svg sprites in a more traditional webpack way and I encourage you to check them out first.

Install

npm i svgstore-webpack-plugin
yarn add svgstore-webpack-plugin

Usage

Options

You can specify loader options the regular way in your webpack config:

const SvgstoreWebpackPlugin = require("svgstore-webpack-plugin");
 
{
    ...
    pluginsmodule: [
        ...
        new SvgstoreWebpackPlugin({
            src: // glob specifing your svg icons/sprites,
            svgOptions: // optional options object for the svgstore package
            context: // root/context for the src glob
        })
    ]
    ...
}

Contributing

All PRs are welcome! Note that conventional changlog/standard version is used for versioning and commit messages.

Roadmap

  • Tests
  • Ability to define several glob patterns in src

Readme

Keywords

Package Sidebar

Install

npm i svgstore-webpack-plugin

Weekly Downloads

1

Version

0.1.0-beta.3

License

MIT

Unpacked Size

145 kB

Total Files

12

Last publish

Collaborators

  • andrejbaran