Skip to content

Commit

Permalink
update dependencies, fix #34
Browse files Browse the repository at this point in the history
  • Loading branch information
Applelo committed Jan 10, 2024
1 parent 9b52279 commit 15afee9
Show file tree
Hide file tree
Showing 8 changed files with 492 additions and 376 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ export default {
}
```

You can access to the spritemap via the route `__spritemap`. All files process by ViteJS will transform the path of the file on build. By default, you will need to use the prefix `sprite-`.
You can access to the spritemap via the route `/__spritemap`. All files process by ViteJS will transform the path of the file on build. By default, you will need to use the prefix `sprite-`.

**SVG**

```html
<svg>
<use xlink:href="__spritemap#sprite-spiriit"></use>
<use xlink:href="/__spritemap#sprite-spiriit"></use>
</svg>
```

Expand All @@ -58,7 +58,7 @@ You can access to the spritemap via the route `__spritemap`. All files process b
You need to add the suffix `-view` to access to the fragment.

```html
<img src="__spritemap#sprite-spiriit-view" />
<img src="/__spritemap#sprite-spiriit-view" />
```

**CSS**
Expand Down Expand Up @@ -127,13 +127,13 @@ will generate
```html
<svg>
<title>My superb logo</title>
<use xlink:href="__spritemap#sprite-spiriit"></use>
<use xlink:href="/__spritemap#sprite-spiriit"></use>
</svg>
<svg>
<use xlink:href="__spritemap#sprite-vite"></use>
<use xlink:href="/__spritemap#sprite-vite"></use>
</svg>
<img src="__spritemap#sprite-spiriit-view" width="118" height="38">
<img src="__spritemap#sprite-vite-view" width="31" height="32">
<img src="/__spritemap#sprite-spiriit-view" width="118" height="38">
<img src="/__spritemap#sprite-vite-view" width="31" height="32">
```

> For typescript, you need to load `/// <reference types="@spiriit/vite-plugin-svg-spritemap/client" />` to fix errors with `?use`/`?view` query.
Expand Down
8 changes: 4 additions & 4 deletions demo/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ <h2>Spritemap with &lt;use></h2>

<div class="example__svgs">
<svg class="icon icon-spiriit">
<use href="__spritemap#icon-spiriit"></use>
<use href="/__spritemap#icon-spiriit"></use>
</svg>
<svg class="icon icon-vite">
<use href="__spritemap#icon-vite"></use>
<use href="/__spritemap#icon-vite"></use>
</svg>
</div>
</div>
Expand All @@ -28,8 +28,8 @@ <h2>Spritemap with &lt;use></h2>
<h2>Spritemap with &lt;img> (fragments)</h2>

<div class="example__svgs">
<img class="icon icon-spiriit" src="__spritemap#icon-spiriit-view" />
<img class="icon icon-vite" src="__spritemap#icon-vite-view" />
<img class="icon icon-spiriit" src="/__spritemap#icon-spiriit-view" />
<img class="icon icon-vite" src="/__spritemap#icon-vite-view" />
</div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions demo/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"@spiriit/vite-plugin-svg-spritemap": "workspace:*",
"autoprefixer": "^10.4.16",
"less": "^4.2.0",
"postcss": "^8.4.32",
"sass": "^1.69.5",
"postcss": "^8.4.33",
"sass": "^1.69.7",
"stylus": "^0.62.0",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite": "^5.0.11",
"vite-plugin-inspect": "^0.8.1"
}
}
6 changes: 3 additions & 3 deletions demo/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"@spiriit/vite-plugin-svg-spritemap": "workspace:*",
"autoprefixer": "^10.4.16",
"concurrently": "^8.2.2",
"postcss": "^8.4.32",
"sass": "^1.69.5",
"postcss": "^8.4.33",
"sass": "^1.69.7",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite": "^5.0.11",
"vite-plugin-inspect": "^0.8.1"
}
}
10 changes: 5 additions & 5 deletions demo/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.3.12"
"vue": "^3.4.7"
},
"devDependencies": {
"@spiriit/vite-plugin-svg-spritemap": "workspace:*",
"@vitejs/plugin-vue": "^4.5.2",
"sass": "^1.69.5",
"@vitejs/plugin-vue": "^5.0.3",
"sass": "^1.69.7",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vue-tsc": "^1.8.25"
"vite": "^5.0.11",
"vue-tsc": "^1.8.27"
}
}
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@spiriit/vite-plugin-svg-spritemap",
"type": "module",
"version": "2.1.0",
"packageManager": "pnpm@8.12.1",
"version": "2.2.0",
"packageManager": "pnpm@8.14.0",
"description": "Generates symbol-based SVG spritemap from all .svg files in a directory",
"author": "Spiriit",
"license": "MIT",
Expand Down Expand Up @@ -57,8 +57,8 @@
"prepublishOnly": "pnpm build"
},
"peerDependencies": {
"vite": "^4.0.0 || ^5.0.0",
"vue": "^3.0.0"
"vite": "^5.0.11",
"vue": "^3.4.7"
},
"peerDependenciesMeta": {
"vue": {
Expand All @@ -70,24 +70,24 @@
"fast-glob": "^3.3.2",
"hash-sum": "^2.0.0",
"mini-svg-data-uri": "^1.4.4",
"svgo": "^3.1.0"
"svgo": "^3.2.0"
},
"devDependencies": {
"@antfu/eslint-config": "2.4.6",
"@antfu/eslint-config": "2.6.2",
"@types/hash-sum": "^1.0.2",
"@types/node": "^20.10.5",
"@types/node": "^20.10.8",
"@types/xmldom": "^0.1.34",
"@vitejs/plugin-vue": "^4.5.2",
"@vitest/coverage-v8": "^1.0.4",
"c8": "^8.0.1",
"@vitejs/plugin-vue": "^4.6.2",
"@vitest/coverage-v8": "^1.1.3",
"c8": "^9.0.0",
"eslint": "^8.56.0",
"playwright": "^1.40.1",
"rollup": "^4.9.1",
"rollup": "^4.9.4",
"svg-element-attributes": "^2.1.0",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vitest": "^1.0.4",
"vue": "^3.3.12"
"vite": "^5.0.11",
"vitest": "^1.1.3",
"vue": "^3.4.7"
}
}
Loading

0 comments on commit 15afee9

Please sign in to comment.