1.0.22 • Published 1 year ago

@devtea2027/delectus-cupiditate-provident-itaque v1.0.22

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

@devtea2027/delectus-cupiditate-provident-itaque

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/delectus-cupiditate-provident-itaque
# using pnpm
pnpm install -D @devtea2027/delectus-cupiditate-provident-itaque
# using yarn
yarn add --dev @devtea2027/delectus-cupiditate-provident-itaque

Usage

Vite config

import { svgSpritemap } from '@devtea2027/delectus-cupiditate-provident-itaque';

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.
serializegradients cssenvindicatorsymlinktrimRighturlsjavascriptbusyArray.prototype.findLastObject.getPrototypeOfexpresssafenegativearraybufferyamlloadbalancing256duplexcss lessmixinsES2017collectionkoreanmacosformsbluebirdreact-hooksSymbolaccessibilityhttpbufferslinuxtermendpointequalECMAScript 2018argspackagedeterministicextrafastcopyfindasciiArray.prototype.includestc39openerWeakMapfast-cloneextendsigintkeyshashArray.prototype.filtersestrimEndcloudtrailworkspace:*touchES8prefixdebugwebwatchingfind-upregularArrayBuffertypeerrorlistenerseslintpluginpropformattingInt8ArrayasyncxtermuninstalliterationstringECMAScript 5charactersgetOwnPropertyDescriptorpnpm9Function.prototype.nameECMAScript 2015ES2021es2016preprocessortoStringTagwalkingbootstrap lesskeyyupfetch__proto__groupMicrosoftdeepObject.valuesgdprajvtoolkittypesregular expressioneslintconfigwatchtyped arraybreakstreams2argparseObject.isdataweaksetshamcryptoes2015randomes5validateprettyReactiveExtensionsrestdescriptorscoerciblelaunchObject.entriescomputed-typesgradients css3URLtypedarraysspinnerloggingdescriptorUint16Array_.extendSetstartfpsagentspeedgenericsstatelessjsxrapidprotobuftypedarraychinesegroupByprivatehasOwnPropertyproxyfile systemdeepcloneReactiveXemojitoSortedclass-validatoridentifiersassignsomeWeakSetfindLastrmpostcss-plugindirObjectcore-jshandlerswgetObservableparsesnsownObject.keystypeofxdgjoiutilcolourappassertenumerableelasticacheguidregexpfullwidthjsartchromedatepushescapegetintrinsicECMAScript 7schematextflatidleredactArrayBuffer.prototype.sliceequalityfast-copybindform-validationtestingopenloggerUint8ClampedArraytypanionwordbreaklookviewbannermrupromisessettertrimLeftassertionpolyfillrobustchaiprototypevestargvintrinsicfullvariables in cssSymbol.toStringTagcallstateES2018fastclonehooksfindLastIndexec2omitvisualutil.inspectglobalobjectconfigshellCSSpropertiesoptionlengtheslint-plugintoolselmmatchesURLSearchParamscallbackFloat32Arrayhelperses-shimstaskimportexportcode pointsbyteOffsetarraysBigInt64Arrayelectrondropnegative zeromapmochafunctionpreserve-symlinksparserYAMLdescriptionlinewraplesscssoptimistweakmapsameValueZeroiteratorformatbatchauthenticationobjfigletES3offsetsignalECMAScript 3colornpmttyinputvaluecopysigtermEScensorautoprefixerTypedArrayObject.definePropertyes8typedajaxstarterurlES2022queuewafrmdirsyntaxerrorsettingsRxhotchecksideUnderscoreinstallerbcrypteventDispatcherargumentserrorpackagesjasminedefaultgettermake dirmulti-packagebrowserlisthardlinksisConcatSpreadablerangeerrorlastless mixinsawesomesauceutilitiespipevariablesES5concatMapwhichtostringtagswfclassnamesuuidcompile lessunicodequeueMicrotaskECMAScript 2022call-boundstringifierdebuggerflagslinkestreenumberpathtypesafea11ysequencephonetslibRegExp.prototype.flagstimeratediffconfigurablecloudformationmatchAllthrottlesymlinkscall-bindonceArrayAsyncIteratorbufferinternalglobalsdotenvqscollection.es6has-ownECMAScript 2017modulelockfileexecutablecommand-linestreamspackage managernoderfc4122stablereal-timewritablenodejs@@toStringTagjsdomdayjsdefinewatchervalidrdscss variablefilesetstreamastjsonchannelArrayBuffer#sliceObject.fromEntriesupTypeBoxformhasrm -frclassesstdlibjsdiffslotworker
1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago