preact-svg-loader

0.2.1 • Public • Published

preact-svg-loader

Load svg files as preact components.

Install

npm i --save-dev preact-svg-loader
// or
yarn add --dev preact-svg-loader

Usage

Add the loader to your webpack config.

rules: [
    {
        test: /\.svg$/,
        use: ['preact-svg-loader'],
    }
]

In your code, simply require the svg as if it were a component.

import Logo from './logo.svg';
 
() => <Logo />

/preact-svg-loader/

    Package Sidebar

    Install

    npm i preact-svg-loader

    Weekly Downloads

    2,011

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    6.22 kB

    Total Files

    5

    Last publish

    Collaborators

    • vuex