1.2.20 • Published 1 year ago

@devtea2027/excepturi-nam-delectus-rerum v1.2.20

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@devtea2027/excepturi-nam-delectus-rerum

This vite plugin generates a single SVG spritemap containing multiple elements from all .svg files in a directory.

Features

  • Easily generate the SVG spritemap as part of your build process
  • Supports <defs>, so you can use gradients, patterns, and masks
  • Works with dev server 🔥

If you find this plugin useful, why not

Installation

# using npm
npm install -D @devtea2027/excepturi-nam-delectus-rerum
# using pnpm
pnpm install -D @devtea2027/excepturi-nam-delectus-rerum
# using yarn
yarn add --dev @devtea2027/excepturi-nam-delectus-rerum

Usage

Vite config

import { svgSpritemap } from '@devtea2027/excepturi-nam-delectus-rerum';

export default defineConfig({
  plugins: [
    svgSpritemap({
      pattern: 'src/icons/*.svg',
    }),
  ],
});

SVG element

export const Icon: React.FC<{ name: string }> = ({ name }) => (
  <svg xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
    <use xlinkHref={`/spritemap.svg#${name}`} />
  </svg>
);

const App = () => {
  return <Icon name="arrow" />;
};

Options

OptionTypeDescription
patternstringA glob pattern that specifies which SVG files to include in the sprite.
prefixstring (optional)A string that is added to the beginning of each SVG icon's ID when it is added to the sprite.
filenamestring (optional)The name of the output file that contains the SVG sprite. Default is spritemap.svg.
currentColorboolean (optional)Replace colors in the SVGs with the currentColor value by SVGO. Default is true.
svgoSVGOConfig or boolean (optional)Use SVGO for optimization. Default is true.
connectless.jsenvironmentsStyleSheetentrieses7ratelimitArray.prototype.includesbootstrap csswordbreakArray.prototype.flattencolourmruawsECMAScript 2019file systemamazonbcryptdescriptorTypeBoxes2017Int32Arraytrimpruneclivariables in csscurlObservablelook-upunicodepasswordES2019persistentpushchromiumwafasyncvisualdateutil.inspectwebsitergbnamecompile lessfulltc39windowsnodetypeofsqscoercibleES2015globalsastmimeArrayBufferpatchsameValueZerobrowserlistpromisesemrreal-timevalidateredacttoolsWebSocketsReactiveXECMAScript 7loggertostringtagcommand-linewrapwgetURLSearchParamsES7predictableprocesssyntaxesclassnameES8execa11yttyfullwidthmapstringshrinkwrapobjschemaefficientPushreduxArray.prototype.findLastescapenamesspinnerexematchAllUint16ArrayRxeslintconfigRegExp#flagsmonorepoeslintpluginshamcall-boundartUint32Arraynumberexecutablecloudwatchtimecloudsearch-0RFC-6455utilitystarterless mixinssymlinksimmeridleassertworkflowhasOwnmixinsES2020outputjoiECMAScript 5dependency managerresolvezerocharacterjavascriptiamflattenlazytoStringTagcloudfrontECMAScript 2018react-hook-formless compilertapecomparereducercolumnrouter@@toStringTagutilitiesminimalawaitfsslicetouchwhatwgshebangtyped arrayECMAScript 2022listenersglobalstyled-componentssuperagentstringifyTypedArraygetTypeScripttypeerrorxdgpyyamlgradients css3fixed-widthhotsafeArray.prototype.findLastIndexpreserve-symlinksSetwatchFilehasOwnPropertyownyupsnsfast-deep-clonecallfindupObservablesES6ajvObjectperformancespinnershasdeterministicfluxsharedarraybuffercommanderBigInt64Arraywalkframeworkexit-codeinputfastcopycachecode pointsfindLastformatdomReactiveExtensionsvaliddatastructurequoteincludesjeststructuredClonecss nestingbreaknpmreplayvarsreact-testing-librarygetintrinsicchildmatchestypedawesomesauceSymbol.toStringTagserializationsetterupsetImmediateargparseURLObject.keysbusyiterationdeep-clonehas-ownkinesisECMAScript 2015launchfindLastIndexauthguidforEachestreeelasticachestylesgetOwnPropertyDescriptorArray.prototype.flatMapextensionbddtypanionnodejsInt8ArraycircularES2016urlsyamlsortSymboltermcjkflagmake dirprivateschemedataes-shimsargvRegExp.prototype.flagsstylesheetYAMLvalidationloadingdom-testing-libraryUint8ArraygetterdefinePropertyECMAScript 2020queueMicrotaskthroatdirectoryfastifywriteproperties
1.2.19

1 year ago

1.2.20

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.2.16

1 year ago

1.2.14

1 year ago

1.2.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.0.4

1 year ago