Skip to content

Commit

Permalink
chore: 🚩 change package name
Browse files Browse the repository at this point in the history
  • Loading branch information
sirSayed98 committed Sep 18, 2024
1 parent 7c24fbf commit 718d82b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sir-svg-sprite
# simple-svg-sprite

A Webpack plugin for creating an SVG sprite from individual SVG files.

Expand All @@ -12,27 +12,27 @@ A Webpack plugin for creating an SVG sprite from individual SVG files.

## Installation

Install `sir-svg-sprite` using npm or yarn as a dev dependency:
Install `simple-svg-sprite` using npm or yarn as a dev dependency:

```console
npm install --save-dev sir-svg-sprite
npm install --save-dev simple-svg-sprite
```
OR
```console
yarn add --dev sir-svg-sprite
yarn add --dev simple-svg-sprite
```
## Usage

Here's how to use the plugin in your Webpack configuration:
```console
// import package
const { SirSVGSprite, GenerateSVGContentHash } = require('sir-svg-sprite');
const { SimpleSVGSprite, GenerateSVGContentHash } = require('simple-svg-sprite');
const svgContentHash = GenerateSVGContentHash('path/to/svgs/folder')

module.exports = {
// ... other webpack config
plugins: [
new SirSVGSprite({
new SimpleSVGSprite({
svgFolderPath: 'path/to/svgs/folder',
spriteOutput: spritemap.${svgContentHash}.svg,
}),
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sir-svg-sprite",
"version": "1.0.1",
"name": "simple-svg-sprite",
"version": "1.0.0",
"description": "A Webpack plugin that generates an SVG sprite",
"main": "src/index.js",
"scripts": {
Expand All @@ -15,7 +15,7 @@
],
"repository": {
"type": "git",
"url": "https://github.com/sirSayed98/sir-svg-sprite"
"url": "https://github.com/sirSayed98/simple-svg-sprite"
},
"author": "sirSayed98",
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const DOMParser = new xmldom.DOMParser();
const XMLSerializer = new xmldom.XMLSerializer();
const XMLDoc = new xmldom.DOMImplementation().createDocument(null, null, null);

class SirSVGSprite {
class SimpleSVGSprite {
constructor(options) {
if (!options || !options.svgFolderPath) {
throw new Error("Error: 'svgFolderPath' option not passed.");
Expand All @@ -24,7 +24,7 @@ class SirSVGSprite {
}

apply(compiler) {
compiler.hooks.emit.tapAsync("SirSVGSprite", (compilation, callback) => {
compiler.hooks.emit.tapAsync("SimpleSVGSprite", (compilation, callback) => {
this.generateSvgSprite()
.then(() => {
compilation.emitAsset(
Expand Down Expand Up @@ -142,4 +142,4 @@ const GenerateSVGContentHash = (content) => {
return data.digest("hex");
};

module.exports = { SirSVGSprite, GenerateSVGContentHash };
module.exports = { SimpleSVGSprite, GenerateSVGContentHash };

0 comments on commit 718d82b

Please sign in to comment.