open-index/open-npm huggingface dataset:
npm package: @svg-component-generator/core
Description: The core of `@svg-component-generator/*`, which can be used in nodejs and browser.
Latest version: 0.2.2

# @svg-component-generator/core

The core of `@svg-component-generator/*`, which can be used in nodejs and browser.

## Install
```bash
npm i @svg-component-generator/core -D
```

## Usage
```javascript
import { generateSvgComponent } from '@svg-component-generator/core';

const {
  jsComponentCode,
  jsxComponentCode,
  interfaceCode
} = generateSvgComponent(`
<svg class="icon" viewBox="0 0 1024 1024" >
  <path fill="#333333" d="M864 120a64 64 0 0 1 64 64v656a64 64 0 0 1-64 64H160a64 64 0 0 1-64-64V184a64 64 0 0 1 64-64h704z m-8 72H168v640h688V192z" />
  <path fill="#333333" d="M112 416h808v72H112z" />
  <path fill="#333333" d="M336 440h72v456h-72zM624 440h72v456h-72z" />
  <path fill="#333333" d="M112 632h808v72H112z" />
</svg>
`, {});
```
npm package: @svg-component-generator/webpack-loader
Latest version: 0.2.2

# @svg-component-generator/webpack-loader


## Install
```bash
npm i @svg-component-generator/webpack-loader -D
```


## Usage
Add `@svg-component-generator/webpack-loader` to the rules config of the webpack.

```javascript
rules: [{
  test: /your-svg-folder\/.*\.svg$/,
  use: [
    {
      loader: '@svg-component-generator/webpack-loader',
      {
        component: 'React',
        target: 'jsx',
        declaration: true
      }
    }
  ]
}]
```


### Configuration

#### component

Type: `React` Default: `React`

Specifies the component type.


#### target
Type: `jsx | js` Default: `jsx`

Specifies the code

#### declaration
Type: `Boolean` Default: `false`

指定是否生成类型文件(.d.ts)，如果设置为`true`，则类型文件会自动生成在图标在所文件夹中。