esbuild-plugin-glsl
Advanced tools
Comparing version
/** | ||
* esbuild-plugin-glsl v1.2.2 build Sat Sep 30 2023 | ||
* esbuild-plugin-glsl v1.2.3 build Sat Mar 08 2025 | ||
* https://github.com/vanruesc/esbuild-plugin-glsl | ||
@@ -7,5 +7,5 @@ * Copyright 2020 Raoul van Rüschen | ||
*/ | ||
function L(l){let a=/[ \t]*(?:(?:\/\*[\s\S]*?\*\/)|(?:\/\/.*\n))/g,c=/\s*([{}=*,+/><&|[\]()\\!?:;-])\s*/g,e=/(\w<\w+>)\s*(\w)/g,r=l.replace(/\r/g,"").replace(a,""),i=!0,n=!1;return r=r.split(/\n+/).reduce((s,t)=>(t=t.trim().replace(/\s{2,}|\t/," "),t[0]==="#"?(n&&s.push(` | ||
function L(l){let a=/[ \t]*(?:(?:\/\*[\s\S]*?\*\/)|(?:\/\/.*\n))/g,c=/\s*([{}=*,+/><&|[\]()\\!?:;-])\s*/g,e=/(\w<\w+>)\s*(\w)/g,r=l.replace(/\r/g,"").replace(a,""),i=!0,n=!1;return r=r.split(/\n+/).reduce((s,t)=>(t=t.trim().replace(/\s{2,}|\t/," "),t.startsWith("#")?(n&&s.push(` | ||
`),s.push(t,` | ||
`),n=!1):t.length>0&&(t=t.replace(c,"$1"),!i&&/\w/.test(t[0])&&(t=" "+t),t=t.replace(e,"$1 $2"),s.push(t),i=!/\w/.test(t[t.length-1]),n=!0),s),[]).join(""),r.replace(/\n{2,}/g,` | ||
`)}import*as y from"fs";import*as O from"util";import*as h from"path";var S=O.promisify(y.readFile);async function w(l,a,c){let e=await S(l,"utf8");if(!c)return{contents:e};let r=[],i=[],n=new Set,s=/#include +["']([.\\/\w-]+)["']/g,t=/\r|\n|\r\n/g,o=s.exec(e);for(;o!==null;){let d=o[0],m=o[1],g=h.join(h.dirname(l),m);try{let p=a.get(g);if(p===void 0){let u=await w(g,a,c);u.warnings?.forEach(f=>i.push(f)),u.watchFiles?.forEach(f=>n.add(f)),p=u.contents,a.set(g,p)}r.push({file:g,contents:p,target:d}),n.add(g),o=s.exec(e)}catch{if(o===null)break;let u=e.split(t),f=u.indexOf(o[0]),x=u[f];i.push({text:`File from <${o[0]}> not found`,location:{file:m,line:f+1,length:m.length,column:x.indexOf(m),lineText:x}}),r.push({file:g,contents:"",target:o[0]}),o=s.exec(e)}}for(let d of r)e=e.replace(d.target,d.contents);return a.set(l,e),{contents:e,warnings:i,watchFiles:[...n]}}function E({minify:l=!1,resolveIncludes:a=!0}={}){let c=new Map;return{name:"glsl",setup(e){async function r(i){let{contents:n,warnings:s,watchFiles:t}=await w(i.path,c,a);return{contents:l?L(n):n,warnings:s,watchFiles:t,loader:"text"}}e.onLoad({filter:/\.(?:frag|vert|glsl|wgsl)$/},r)}}}export{E as default,E as glsl}; |
{ | ||
"name": "esbuild-plugin-glsl", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "A GLSL plugin for esbuild.", | ||
@@ -36,4 +36,3 @@ "homepage": "https://github.com/vanruesc/esbuild-plugin-glsl", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/vanruesc/esbuild-plugin-glsl.git" | ||
"url": "git+https://github.com/vanruesc/esbuild-plugin-glsl.git" | ||
}, | ||
@@ -46,2 +45,16 @@ "bugs": { | ||
], | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"ava": { | ||
"failFast": true, | ||
"files": [ | ||
"test/*.js" | ||
] | ||
}, | ||
"pnpm": { | ||
"onlyBuiltDependencies": [ | ||
"esbuild" | ||
] | ||
}, | ||
"scripts": { | ||
@@ -57,14 +70,2 @@ "ava": "ava", | ||
}, | ||
"ava": { | ||
"failFast": true, | ||
"files": [ | ||
"test/*.js" | ||
] | ||
}, | ||
"eslintConfig": { | ||
"extends": "aether/typescript" | ||
}, | ||
"engines": { | ||
"node": ">= 0.10.18" | ||
}, | ||
"peerDependencies": { | ||
@@ -74,10 +75,10 @@ "esbuild": "0.x.x" | ||
"devDependencies": { | ||
"@types/node": "20.x.x", | ||
"@typescript-eslint/eslint-plugin": "6.x.x", | ||
"@typescript-eslint/parser": "6.x.x", | ||
"ava": "5.x.x", | ||
"del-cli": "5.x.x", | ||
"esbuild": "0.x.x", | ||
"eslint": "8.x.x", | ||
"eslint-config-aether": "1.x.x", | ||
"@types/node": "22.x.x", | ||
"@typescript-eslint/eslint-plugin": "8.x.x", | ||
"@typescript-eslint/parser": "8.x.x", | ||
"ava": "6.x.x", | ||
"del-cli": "6.x.x", | ||
"esbuild": "0.25.x", | ||
"eslint": "9.x.x", | ||
"eslint-config-aether": "2.x.x", | ||
"npm-run-all": "4.x.x", | ||
@@ -84,0 +85,0 @@ "tslib": "2.x.x", |
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
10044
0.01%3
50%3
50%