@toba/html-webpack-inline-svg
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @toba/html-webpack-inline-svg

Weekly Downloads

1

Version

1.0.10

License

MIT

Unpacked Size

15.8 kB

Total Files

9

Last publish

Collaborators

  • jason-abbott