open-index/open-npm huggingface dataset:
npm package: @neodx/svg-sprite
Description: Build optimized SVG sprites without pain
Latest version: 0.0.1

<h1 align="center">
  <a aria-label="SVG sprite" href="https://github.com/secundant/neodx/libs/svg-sprite">
    🗃@neodx/svg-sprite - SVG sprites generator
  </a>
</h1>
<p align="center">
  Flexible SVG sprites generator
</p>

- Optimizes output with svgo
- Creates TypeScript`s interface with generated sprites info
- Creates meta information about sprites
- Provides plugins system for specific extensions

## Installation

- Yarn: `yarn add -D @neodx/svg-sprite`
- NPM: `npm i -D @neodx/svg-sprite`

## Getting started

```shell
# Run our CLI when configuration is ready
yarn sprite build
```

We use [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) under the hood,
you need create `.spriterc.js`:

```javascript
/**
 * Example of minimal configuration
 * @type {import('@neodx/svg-sprite').Configuration}
 */
module.exports = {
  input: 'assets/svg/*.svg',
  outputRoot: 'public'
};
```

## Advanced configuration

```javascript
const { plugins } = require('@neodx/svg-sprite');

/**
 * @type {import('@neodx/svg-sprite').Configuration}
 */
module.exports = {
  /**
   * Input can also be an array and take base url in "inputRoot" option.
   * In this example we will scan all files in [assets/static/..., assets/tmp/...]
   */
  input: ['static/**/*.svg', 'tmp/*.svg'],
  inputRoot: 'assets',
  /**
   * You can set multiple outputs
   */
  outputRoot: ['public/sprites', '.build/assets/sprites'],
  /**
   * {name} will be replaced with sprite name ("sprite" by default)
   */
  fileName: '{name}.svg',
  /**
   * Override plugins. By default enabled svgo, setId and resetColors
   */
  plugins: [
    // Enable default plugins
    plugins.svgo(),
    plugins.setId(),
    plugins.resetColors(),
    /**
     * Plugin for grouping inputs to multiple sprites, will be useful for large icon sets.
     * Group inputs by relative directory name by default
     * @example Look at files structure below:
     * - actions/
     * - - add.svg
     * - - close.svg
     * - - subfolder/
     * - - - submit.svg
     * - alerts/
     * - - info.svg
     * - hello.svg
     * This will group sprites as {
     *   actions: ['add', 'close'],
     *   'actions/subfolder': ['submit'],
     *   alerts: ['info'],
     *   __root: ['hello']
     * }
     */
    plugins.group({
      defaultName: '__root'
    }),
    /**
     * This plugin will generate "shared/types/sprite.ts" with:
     * - export interface SpriteMap { modals: 'add' | 'close'; ... }
     * - export const spriteMap = { modals: ['add', 'close'] }
     */
    plugins.typescript({
      output: 'shared/types/sprite.ts',
      metaName: 'spriteMap',
      typeName: 'SpriteMap'
    })
  ]
};
```
npm package: @neodx/vite-plugin-library
Description: No description
Latest version: 0.0.6

# @neodx/builder

[Vite](https://vitejs.dev/) plugin for simple libraries setup

## Examples

### Basic usage

```typescript
import { defineConfig } from 'vite';
import library from '@neodx/vite-plugin-library';

export default defineConfig({
  plugins: [library()]
});
```

### Typescript

```shell
yarn add -D vite-tsconfig-paths vite-plugin-dts
```

```typescript
import { defineConfig } from 'vite';
import library from '@neodx/vite-plugin-library';
import tsconfigPaths from 'vite-tsconfig-paths';
import dts from 'vite-tsconfig-paths';

export default defineConfig({
  plugins: [tsconfigPaths(), dts(), library()]
});
```

### Generate package.json fields

```typescript
import { defineConfig } from 'vite';
import library from '@neodx/vite-plugin-library';
import tsconfigPaths from 'vite-tsconfig-paths';
import dts from 'vite-tsconfig-paths';

export default defineConfig({
  plugins: [
    tsconfigPaths(),
    dts(),
    library({
      updatePackageExports: true,
      updatePackageMainFields: true // defaults to "updatePackageExports"
    })
  ]
});
```

### Custom entries

#### One entry (other than "index.ts")

```typescript
export default defineConfig({
  plugins: [
    // ...
    library({
      entry: 'src/other.ts'
    })
  ]
});
```

#### Multiple static entries

```typescript
export default defineConfig({
  plugins: [
    // ...
    library({
      entry: ['src/index.ts', 'src/other/file.ts']
    })
  ]
});
```

#### Glob

```typescript
export default defineConfig({
  plugins: [
    // ...
    library({
      entry: [
        'src/index.ts',
        'src/*/index.ts',
        '!src/internal/index.ts',
        'src/features/*.ts',
        'src/features/*/index.ts'
      ]
    })
  ]
});
```