Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sooniter/unplugin-svg2solid

transform ".svg" file to Solid-js component
https://github.com/sooniter/unplugin-svg2solid

plugin solid svg unplugin vite vite-plugin

Last synced: 16 days ago
JSON representation

transform ".svg" file to Solid-js component

Awesome Lists containing this project

README

        

# unplugin-svg2solid

[![NPM version](https://img.shields.io/npm/v/unplugin-svg2solid?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-svg2solid)

svg2solidcomp template for [unplugin](https://github.com/unjs/unplugin).

## Install

```bash
npm i unplugin-svg2solid
```

Vite

```ts
// vite.config.ts
import svg2solidcomp from 'unplugin-svg2solid/vite'

export default defineConfig({
plugins: [
svg2solidcomp({
/* options */
}),
],
})
```

Example: [`playground/`](./playground/)


Rollup

```ts
// rollup.config.js
import svg2solidcomp from 'unplugin-svg2solid/rollup'

export default {
plugins: [
svg2solidcomp({
/* options */
}),
],
}
```


Webpack

```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-svg2solid/webpack')({
/* options */
}),
],
}
```


Vue CLI

```ts
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-svg2solid/webpack')({
/* options */
}),
],
},
}
```


esbuild

```ts
// esbuild.config.js
import { build } from 'esbuild'
import svg2solidcomp from 'unplugin-svg2solid/esbuild'

build({
plugins: [svg2solidcomp()],
})
```