Insert SVG files into index.html
generated by the Webpack HTML plugin so they can be use
d within components.
yarn add @toba/html-webpack-inline-svg --dev
import prettyID from './images/pretty.svg';
const header = props => (
<svg viewBox="0 0 30 10">
<use href={prettyID} x="10" />
</svg>
);
import { HtmlSvgPlugin } from '@toba/html-webpack-inline-svg';
export = {
// ...
plugins: [new HtmlWebpackPlugin(), new HtmlSvgPlugin()];
}
Copyright © 2019 Jason Abbott
This software is licensed under the MIT license. See the LICENSE file accompanying this software for terms of use.