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 />

Readme

Keywords

none

Package Sidebar

Install

npm i preact-svg-loader

Weekly Downloads

1,743

Version

0.2.1

License

MIT

Unpacked Size

6.22 kB

Total Files

5

Last publish

Collaborators

  • vuex