esbuild-plugin-glsl
Advanced tools
Comparing version 1.1.0 to 1.1.1
/** | ||
* esbuild-plugin-glsl v1.1.0 build Thu Mar 24 2022 | ||
* esbuild-plugin-glsl v1.1.1 build Sun Mar 12 2023 | ||
* https://github.com/vanruesc/esbuild-plugin-glsl | ||
* Copyright 2022 Raoul van Rüschen | ||
* Copyright 2023 Raoul van Rüschen | ||
* @license Zlib | ||
*/ | ||
import*as a from"fs";import*as u from"util";function l(n){let o=/[ \t]*(?:(?:\/\*[\s\S]*?\*\/)|(?:\/\/.*\n))/g,i=/\s*([{}=*,+/><&|[\]()\-!?:;])\s*/g,t=n.replace(/\r/g,"").replace(o,""),s=!1;return t=t.split(/\n+/).reduce((e,r)=>(r=r.trim().replace(/\s{2,}|\t/," "),r[0]==="#"?(s&&e.push(` | ||
`),e.push(r,` | ||
`),s=!1):(r=r.replace(/(else)$/m,"$1 "),e.push(r.replace(i,"$1")),s=!0),e),[]).join(""),t.replace(/\n{2,}/g,` | ||
`)}function g({minify:n=!1}={}){let o=u.promisify(a.readFile);return{name:"glsl",setup(i){async function t(s){let e=await o(s.path,"utf8");return{contents:n?l(e):e,loader:"text"}}i.onLoad({filter:/\.(?:frag|vert|glsl|wgsl)$/},t)}}}export{g as default,g as glsl}; | ||
import*as p from"fs";import*as g from"util";function u(o){let n=/[ \t]*(?:(?:\/\*[\s\S]*?\*\/)|(?:\/\/.*\n))/g,a=/\s*([{}=*,+/><&|[\]()\\!?:;-])\s*/g,i=/(\w<\w+>)\s*(\w)/g,r=o.replace(/\r/g,"").replace(n,""),e=!0,l=!1;return r=r.split(/\n+/).reduce((s,t)=>(t=t.trim().replace(/\s{2,}|\t/," "),t[0]==="#"?(l&&s.push(` | ||
`),s.push(t,` | ||
`),l=!1):t.length>0&&(t=t.replace(a,"$1"),!e&&/\w/.test(t[0])&&(t=" "+t),t=t.replace(i,"$1 $2"),s.push(t),e=!/\w/.test(t[t.length-1]),l=!0),s),[]).join(""),r.replace(/\n{2,}/g,` | ||
`)}function d({minify:o=!1}={}){let n=g.promisify(p.readFile);return{name:"glsl",setup(a){async function i(r){let e=await n(r.path,"utf8");return{contents:o?u(e):e,loader:"text"}}a.onLoad({filter:/\.(?:frag|vert|glsl|wgsl)$/},i)}}}export{d as default,d as glsl}; |
{ | ||
"name": "esbuild-plugin-glsl", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A GLSL plugin for esbuild.", | ||
@@ -67,7 +67,7 @@ "homepage": "https://github.com/vanruesc/esbuild-plugin-glsl", | ||
"devDependencies": { | ||
"@types/node": "17.x.x", | ||
"@types/node": "18.x.x", | ||
"@typescript-eslint/eslint-plugin": "5.x.x", | ||
"@typescript-eslint/parser": "5.x.x", | ||
"ava": "4.x.x", | ||
"del-cli": "4.x.x", | ||
"ava": "5.x.x", | ||
"del-cli": "5.x.x", | ||
"esbuild": "0.x.x", | ||
@@ -74,0 +74,0 @@ "eslint": "8.x.x", |
Sorry, the diff of this file is not supported yet
6998