esbuild-plugin-less
Advanced tools
Comparing version 1.2.4 to 1.3.0
@@ -1,1 +0,1 @@ | ||
var I=Object.create;var l=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var E=(e,t)=>{for(var s in t)l(e,s,{get:t[s],enumerable:!0})},v=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of S(t))!C.call(e,r)&&r!==s&&l(e,r,{get:()=>t[r],enumerable:!(i=w(t,r))||i.enumerable});return e};var m=(e,t,s)=>(s=e!=null?I($(e)):{},v(t||!e||!e.__esModule?l(s,"default",{value:e,enumerable:!0}):s,e)),O=e=>v(l({},"__esModule",{value:!0}),e);var U={};E(U,{lessLoader:()=>T});module.exports=O(U);var y=m(require("path")),R=require("fs"),D=m(require("less"));var p=m(require("fs")),a=m(require("path")),P=/@import.*?["']([^"']+)["'].*?/,k=/@import.*?["']([^"']+)["'].*?/g,F=/(?:\/\*(?:[\s\S]*?)\*\/)|(\/\/(?:.*)$)/gm,M=[".css",".less"],x=(e,t=[])=>{try{let s=a.default.dirname(e),o=(p.default.readFileSync(e).toString("utf8").replace(F,"").match(k)||[]).map(n=>n.match(P)[1]).filter(n=>!!n).map(n=>{let c=a.default.resolve(s,a.default.extname(n)?n:`${n}.less`);if(!p.default.existsSync(c))for(let h=0;h<t.length;h++){let g=a.default.resolve(t[h],a.default.extname(n)?n:`${n}.less`);if(p.default.existsSync(g)){c=g;break}}return c});return o.reduce((n,c)=>[...n,...x(c,t)],o).filter(n=>M.includes(a.default.extname(n).toLowerCase()))}catch{return[]}},L=e=>{let t=e.extract.filter(i=>i),s=t.length===3?t[1]:t[0];return{text:e.message,location:{namespace:"file",file:e.filename,line:e.line,column:e.column,lineText:s}}};var T=(e={},t={})=>({name:"less-loader",setup:s=>{let i=t.filter;s.onResolve({filter:i||/\.less$/,namespace:"file"},async r=>{let o=(await s.resolve(r.path,{kind:r.kind,importer:r.importer,resolveDir:r.resolveDir,pluginData:r.pluginData})).path;return{path:o,watchFiles:[o,...x(o,e.paths||[])]}}),s.onLoad({filter:i||/\.less$/,namespace:"file"},async r=>{let f=await R.promises.readFile(r.path,"utf-8"),o=y.default.dirname(r.path),d={filename:r.path,relativeUrls:!0,...e,paths:[...e.paths||[],o]};try{return{contents:(await D.default.render(f,d)).css,loader:"css",resolveDir:o}}catch(u){return{errors:[L(u)],resolveDir:o}}})}});0&&(module.exports={lessLoader}); | ||
var I=Object.create;var m=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var s in t)m(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of S(t))!b.call(e,r)&&r!==s&&m(e,r,{get:()=>t[r],enumerable:!(a=w(t,r))||a.enumerable});return e};var p=(e,t,s)=>(s=e!=null?I($(e)):{},g(t||!e||!e.__esModule?m(s,"default",{value:e,enumerable:!0}):s,e)),E=e=>g(m({},"__esModule",{value:!0}),e);var W={};C(W,{lessLoader:()=>F});module.exports=E(W);var d=p(require("path")),L=require("fs"),y=p(require("less"));var f=p(require("fs")),c=p(require("path")),M=/@import.*?["']([^"']+)["'].*?/,O=/@import.*?["']([^"']+)["'].*?/g,P=/(?:\/\*(?:[\s\S]*?)\*\/)|(\/\/(?:.*)$)/gm,k=[".css",".less"],h=(e,t=[])=>{try{let s=c.default.dirname(e),n=(f.default.readFileSync(e).toString("utf8").replace(P,"").match(O)||[]).map(o=>o.match(M)[1]).filter(o=>!!o).map(o=>{let i=c.default.resolve(s,c.default.extname(o)?o:`${o}.less`);if(!f.default.existsSync(i))for(let l=0;l<t.length;l++){let x=c.default.resolve(t[l],c.default.extname(o)?o:`${o}.less`);if(f.default.existsSync(x)){i=x;break}}return i});return n.reduce((o,i)=>[...o,...h(i,t)],n).filter(o=>k.includes(c.default.extname(o).toLowerCase()))}catch{return[]}},v=e=>{let t=e.extract.filter(a=>a),s=t.length===3?t[1]:t[0];return{text:e.message,location:{namespace:"file",file:e.filename,line:e.line,column:e.column,lineText:s}}};var F=(e={},t={})=>({name:"less-loader",setup:s=>{let a=t.filter;s.onResolve({filter:a||/\.less$/,namespace:"file"},async r=>{let n=(await s.resolve(r.path,{kind:r.kind,importer:r.importer,resolveDir:r.resolveDir,pluginData:r.pluginData})).path;return{path:n,watchFiles:[n,...h(n,e.paths||[])]}}),s.onLoad({filter:a||/\.less$/,namespace:"file"},async r=>{let u=await L.promises.readFile(r.path,"utf-8"),n=d.default.dirname(r.path),o=d.default.basename(r.path).endsWith(".module.less")?"local-css":"css",i={filename:r.path,relativeUrls:!0,...e,paths:[...e.paths||[],n]};try{return{contents:(await y.default.render(u,i)).css,loader:o,resolveDir:n}}catch(l){return{errors:[v(l)],resolveDir:n}}})}});0&&(module.exports={lessLoader}); |
{ | ||
"name": "esbuild-plugin-less", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "esbuild plugin for less files", | ||
@@ -18,8 +18,8 @@ "repository": "https://github.com/iam-medvedev/esbuild-plugin-less.git", | ||
"scripts": { | ||
"build": "NODE_ENV=production ts-node ./scripts/build.ts", | ||
"build": "NODE_ENV=production tsx ./scripts/build.ts", | ||
"build:types": "NODE_ENV=production tsc --emitDeclarationOnly --declaration --outDir build", | ||
"dev:example-ts": "ts-node ./example/build.ts --ts", | ||
"build:example-ts": "NODE_ENV=production ts-node ./example/build.ts --ts", | ||
"dev:example-less": "ts-node ./example/build.ts --less", | ||
"build:example-less": "NODE_ENV=production ts-node ./example/build.ts --less", | ||
"dev:example-ts": "tsx ./example/build.ts --ts", | ||
"build:example-ts": "NODE_ENV=production tsx ./example/build.ts --ts", | ||
"dev:example-less": "tsx ./example/build.ts --less", | ||
"build:example-less": "NODE_ENV=production tsx ./example/build.ts --less", | ||
"commit": "yarn git-cz", | ||
@@ -48,19 +48,19 @@ "prepare": "husky install", | ||
"@semantic-release/changelog": "6.0.3", | ||
"@semantic-release/commit-analyzer": "10.0.1", | ||
"@semantic-release/github": "9.0.4", | ||
"@semantic-release/npm": "10.0.4", | ||
"@semantic-release/release-notes-generator": "11.0.4", | ||
"@semantic-release/commit-analyzer": "10.0.4", | ||
"@semantic-release/github": "9.0.6", | ||
"@semantic-release/npm": "10.0.6", | ||
"@semantic-release/release-notes-generator": "11.0.7", | ||
"@types/node": "^20.5.0", | ||
"@vitest/coverage-v8": "^0.34.2", | ||
"@vitest/coverage-v8": "^0.34.4", | ||
"cz-conventional-changelog": "3.3.0", | ||
"esbuild": "^0.19.2", | ||
"esbuild": "^0.19.3", | ||
"git-cz": "4.9.0", | ||
"husky": "^8.0.3", | ||
"lint-staged": "14.0.0", | ||
"prettier": "3.0.2", | ||
"semantic-release": "21.0.7", | ||
"ts-node": "10.9.1", | ||
"typescript": "5.1.6", | ||
"lint-staged": "14.0.1", | ||
"prettier": "3.0.3", | ||
"semantic-release": "21.1.1", | ||
"tsx": "3.12.10", | ||
"typescript": "5.2.2", | ||
"vite": "^4.4.9", | ||
"vitest": "^0.34.2" | ||
"vitest": "^0.34.4" | ||
}, | ||
@@ -71,3 +71,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@types/less": "^3.0.3", | ||
"@types/less": "^3.0.4", | ||
"less": "^4.2.0" | ||
@@ -74,0 +74,0 @@ }, |
Sorry, the diff of this file is not supported yet
10434
11
32
Updated@types/less@^3.0.4