Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.
/ svg-loader Public archive

Streamlined SVG inliner written in TypeScript

License

Notifications You must be signed in to change notification settings

toba/svg-loader

Repository files navigation

npm package Build Status Code style Dependencies DevDependencies Test Coverage

SVG Inliner for the Webpack HTML Plugin

Insert SVG files into index.html generated by the Webpack HTML plugin so they can be used within components.

Usage

yarn add @toba/html-webpack-inline-svg --dev

Within Component

import prettyID from './images/pretty.svg';

const header = props => (
   <svg viewBox="0 0 30 10">
      <use href={prettyID} x="10" />
   </svg>
);

Webpack Configuration

import { HtmlSvgPlugin } from '@toba/html-webpack-inline-svg';

export = {
   // ...
   plugins: [new HtmlWebpackPlugin(), new HtmlSvgPlugin()];
}

License

Copyright © 2019 Jason Abbott

This software is licensed under the MIT license. See the LICENSE file accompanying this software for terms of use.

Releases

No releases published

Packages

No packages published