vite-plugin-material-symbols 0.4.0-beta.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Plugin } from
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
2
|
|
|
3
|
+
//#region src/index.d.ts
|
|
3
4
|
type PluginOptions = {
|
|
4
5
|
/**
|
|
5
6
|
* Material Symbols CSS Provider. Default: outlined, no infill, 24px, weight 400
|
|
@@ -22,4 +23,5 @@ type PluginOptions = {
|
|
|
22
23
|
};
|
|
23
24
|
declare const plugin: ({ component, getUrl, preload, }?: Partial<PluginOptions>) => Plugin;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
//#endregion
|
|
27
|
+
export { plugin as default };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"esquery";const t=e=>e.type===`Literal`&&`value`in e&&typeof e.value==`string`,n=e=>`https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0&${e}`,r=e=>[`CallExpression[callee.name='jsx'][arguments.0.name='${e}']`,`.arguments`,`Property[key.name='children'] Literal`].join(` > `),i=e=>{if(!e.size)return``;let t=[];for(let n of e.values())t.push(n);return`icon_names=${t.toSorted().join(`,`)}`},a=({component:a=`Icon`,getUrl:o=n,preload:s=!1}={})=>{let c=new Set;return{name:`material-symbols`,enforce:`pre`,moduleParsed:function({id:n,ast:i}){if(!i)return;let o=e.query(i,r(a)).filter(t);for(let{value:e}of o)this.debug({id:n,message:e}),c.add(e)},transformIndexHtml:e=>{let t=o(i(c)),n=[{injectTo:`head`,tag:`link`,attrs:{rel:`stylesheet`,href:t}}];return s&&n.push({injectTo:`head-prepend`,tag:`link`,attrs:{rel:`preload`,as:`style`,href:t}},{injectTo:`head-prepend`,tag:`link`,attrs:{rel:`preconnect`,href:`https://fonts.gstatic.com`}}),{html:e,tags:n}}}};var o=a;export{o as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-material-symbols",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Selective loading of Material Symbols for production",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"*.md"
|
|
31
31
|
],
|
|
32
32
|
"engines": {
|
|
33
|
-
"node": "^20 || ^22"
|
|
33
|
+
"node": "^20 || ^22 || ^24"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"vite": "^6.0.0"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"esquery": "^1.6.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@arethetypeswrong/cli": "^0.
|
|
42
|
+
"@arethetypeswrong/cli": "^0.18.0",
|
|
43
43
|
"@biomejs/biome": "1.9.4",
|
|
44
44
|
"@tsconfig/bun": "^1.0.7",
|
|
45
45
|
"@types/bun": "^1.1.14",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react": "^19.0.0",
|
|
52
52
|
"react-dom": "^19.0.0",
|
|
53
53
|
"semver": "^7.6.3",
|
|
54
|
-
"tsdown": "^0.
|
|
54
|
+
"tsdown": "^0.9.3",
|
|
55
55
|
"typescript": "^5.7.2"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|