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

Latest commit

 

History

History
48 lines (34 loc) · 1.56 KB

README.md

File metadata and controls

48 lines (34 loc) · 1.56 KB

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.