一覧へ戻る
taochunyu/rollup-plugin-preact-svg-lite(新しいタブで開きます)
主要言語: JavaScript
rollup plugin for importing svg file in preact
- star 数
- 2
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2022/03/01
主要言語: JavaScript
rollup plugin for importing svg file in preact
Import SVG files in preact.
This is a Rollup plugin for importing SVG files in Preact.
It can work with rollup 2.x.x and @rollup/plugin-typescript 6.x.x.
npm install rollup-plugin-preact-svg-lite -D
// rollup.config.js import svg from 'rollup-plugin-preact-svg-lite'; export default { // ... plugins: [ svg() ] }
// main.ts import {h, FunctionalComponent} from 'preact'; import Logo from 'path/to/logo.svg'; export const App: FunctionalComponent = () => ( <Logo /> );
// rollup.config.js import typescript from "@rollup/plugin-typescript"; import svg from 'rollup-plugin-preact-svg-lite'; export default { // ... plugins: [ typescript(), svg(), ] }