Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vuexltd/preact-svg-loader
A webpack loader to load svg files as preact components.
https://github.com/vuexltd/preact-svg-loader
preact svg webpack webpack-loader
Last synced: 3 months ago
JSON representation
A webpack loader to load svg files as preact components.
- Host: GitHub
- URL: https://github.com/vuexltd/preact-svg-loader
- Owner: VuexLtd
- License: mit
- Created: 2017-02-01T22:02:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-17T13:44:49.000Z (over 6 years ago)
- Last Synced: 2024-10-29T08:24:37.870Z (3 months ago)
- Topics: preact, svg, webpack, webpack-loader
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 22
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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.
```js
rules: [
{
test: /\.svg$/,
use: ['preact-svg-loader'],
}
]
```In your code, simply require the svg as if it were a component.
```jsx
import Logo from './logo.svg';() =>
```