esbuild-plugin-glsl
Advanced tools
Comparing version 1.2.1 to 1.2.2
/** | ||
* esbuild-plugin-glsl v1.2.1 build Thu Apr 13 2023 | ||
* esbuild-plugin-glsl v1.2.2 build Sat Sep 30 2023 | ||
* https://github.com/vanruesc/esbuild-plugin-glsl | ||
@@ -10,2 +10,2 @@ * Copyright 2020 Raoul van Rüschen | ||
`),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;a.set(l,e);let 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{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}; | ||
`)}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.1", | ||
"version": "1.2.2", | ||
"description": "A GLSL plugin for esbuild.", | ||
@@ -71,5 +71,5 @@ "homepage": "https://github.com/vanruesc/esbuild-plugin-glsl", | ||
"devDependencies": { | ||
"@types/node": "18.x.x", | ||
"@typescript-eslint/eslint-plugin": "5.x.x", | ||
"@typescript-eslint/parser": "5.x.x", | ||
"@types/node": "20.x.x", | ||
"@typescript-eslint/eslint-plugin": "6.x.x", | ||
"@typescript-eslint/parser": "6.x.x", | ||
"ava": "5.x.x", | ||
@@ -82,4 +82,4 @@ "del-cli": "5.x.x", | ||
"tslib": "2.x.x", | ||
"typescript": "4.x.x" | ||
"typescript": "5.x.x" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
10043