Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/sooniter/unplugin-svg2solid
- Owner: SoonIter
- License: mit
- Created: 2022-08-15T03:47:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-02T20:51:31.000Z (over 1 year ago)
- Last Synced: 2024-12-01T04:26:48.366Z (24 days ago)
- Topics: plugin, solid, svg, unplugin, vite, vite-plugin
- Language: TypeScript
- Homepage:
- Size: 99.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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()],
})
```