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 CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Version 0
4
4
 
5
+ ### v0.5.0
6
+
7
+ - Supporting Node 24.
8
+
5
9
  ### v0.4.0
6
10
 
7
11
  - New option: `preload`, boolean:
package/README.md CHANGED
@@ -18,7 +18,7 @@ the font downloaded by the user.
18
18
 
19
19
  ## Requirements
20
20
 
21
- - Node.js `^20 || ^22`;
21
+ - Node.js `^20 || ^22 || ^24`;
22
22
  - Vite `^6.0.0` (though, it might work with v5 as well).
23
23
 
24
24
  ## Installation
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { Plugin } from 'vite';
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
- export { plugin as default };
26
+ //#endregion
27
+ export { plugin as default };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import esquery from "esquery";const isStringLiteral=(h)=>h.type==="Literal"&&"value"in h&&typeof h.value==="string",defaultUrlProvider=(h)=>`https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0&${h}`,makeSelector=(h)=>[`CallExpression[callee.name='jsx'][arguments.0.name='${h}']`,".arguments","Property[key.name='children'] Literal"].join(" > "),makeIconNamesParam=(h)=>{if(!h.size)return "";const i=[];for(const j of h.values())i.push(j);return `icon_names=${i.toSorted().join(",")}`},plugin=({component:h="Icon",getUrl:i=defaultUrlProvider,preload:j=!1}={})=>{const k=new Set();return {name:"material-symbols",enforce:"pre",moduleParsed:function({id:l,ast:m}){if(!m)return;const n=esquery.query(m,makeSelector(h)).filter(isStringLiteral);for(const {value:o}of n)this.debug({id:l,message:o}),k.add(o)},transformIndexHtml:(l)=>{const m=i(makeIconNamesParam(k)),n=[{injectTo:"head",tag:"link",attrs:{rel:"stylesheet",href:m}}];if(j)n.push({injectTo:"head-prepend",tag:"link",attrs:{rel:"preload",as:"style",href:m}},{injectTo:"head-prepend",tag:"link",attrs:{rel:"preconnect",href:"https://fonts.gstatic.com"}});return {html:l,tags:n}}}};var src_default=plugin;export {src_default as default};
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.4.0-beta.3",
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.17.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.5.0",
54
+ "tsdown": "^0.9.3",
55
55
  "typescript": "^5.7.2"
56
56
  },
57
57
  "keywords": [