esbuild-plugin-less
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,1 +0,1 @@ | ||
var E=Object.create;var c=Object.defineProperty,O=Object.defineProperties,P=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,F=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var x=(e,t,s)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,L=(e,t)=>{for(var s in t||(t={}))g.call(t,s)&&x(e,s,t[s]);if(d)for(var s of d(t))S.call(t,s)&&x(e,s,t[s]);return e},v=(e,t)=>O(e,$(t)),w=e=>c(e,"__esModule",{value:!0});var b=(e,t)=>{for(var s in t)c(e,s,{get:t[s],enumerable:!0})},M=(e,t,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of D(t))!g.call(e,o)&&o!=="default"&&c(e,o,{get:()=>t[o],enumerable:!(s=P(t,o))||s.enumerable});return e},l=e=>M(w(c(e!=null?E(F(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);w(exports);b(exports,{lessLoader:()=>q});var p=l(require("path")),y=l(require("fs")),C=l(require("less"));var I=l(require("fs")),m=l(require("path")),T=/@import(?:\s+\((.*)\))?\s+['"](.*)['"]/,W=/@import(?:\s+\((.*)\))?\s+['"](.*)['"]/g,j=/(?:\/\*(?:[\s\S]*?)\*\/)|(\/\/(?:.*)$)/gm,k=[".css",".less"],f=e=>{try{let t=m.default.dirname(e),n=(I.default.readFileSync(e).toString("utf8").replace(j,"").match(W)||[]).map(r=>r.match(T)[2]).filter(r=>!!r).map(r=>m.default.resolve(t,m.default.extname(r)?r:`${r}.less`));return n.reduce((r,h)=>[...r,...f(h)],n).filter(r=>k.includes(m.default.extname(r).toLowerCase()))}catch(t){return[]}},R=e=>{let t=e.extract.filter(o=>o),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 q=(e={},t={})=>({name:"less-loader",setup:s=>{let o=t.filter;s.onResolve({filter:o||/\.less$/,namespace:"file"},a=>{let n=p.default.resolve(process.cwd(),p.default.relative(process.cwd(),a.resolveDir),a.path);return{path:n,watchFiles:s.initialOptions.watch?[n,...f(n)]:void 0}}),s.onLoad({filter:o||/\.less$/,namespace:"file"},async a=>{let n=await y.promises.readFile(a.path,"utf-8"),i=p.default.dirname(a.path),u=p.default.basename(a.path);try{return{contents:(await C.default.render(n,v(L({filename:u,rootpath:i},e),{paths:[...e.paths||[],i]}))).css,loader:"css",resolveDir:i}}catch(r){return{errors:[R(r)],resolveDir:i}}})}});0&&(module.exports={lessLoader}); | ||
var E=Object.create;var c=Object.defineProperty,O=Object.defineProperties,P=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,F=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var x=(e,t,s)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,L=(e,t)=>{for(var s in t||(t={}))g.call(t,s)&&x(e,s,t[s]);if(d)for(var s of d(t))S.call(t,s)&&x(e,s,t[s]);return e},v=(e,t)=>O(e,$(t)),w=e=>c(e,"__esModule",{value:!0});var b=(e,t)=>{w(e);for(var s in t)c(e,s,{get:t[s],enumerable:!0})},M=(e,t,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of D(t))!g.call(e,o)&&o!=="default"&&c(e,o,{get:()=>t[o],enumerable:!(s=P(t,o))||s.enumerable});return e},l=e=>M(w(c(e!=null?E(F(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);b(exports,{lessLoader:()=>q});var p=l(require("path")),y=l(require("fs")),C=l(require("less"));var I=l(require("fs")),m=l(require("path")),T=/@import(?:\s+\((.*)\))?\s+['"](.*)['"]/,W=/@import(?:\s+\((.*)\))?\s+['"](.*)['"]/g,j=/(?:\/\*(?:[\s\S]*?)\*\/)|(\/\/(?:.*)$)/gm,k=[".css",".less"],f=e=>{try{let t=m.default.dirname(e),n=(I.default.readFileSync(e).toString("utf8").replace(j,"").match(W)||[]).map(r=>r.match(T)[2]).filter(r=>!!r).map(r=>m.default.resolve(t,m.default.extname(r)?r:`${r}.less`));return n.reduce((r,h)=>[...r,...f(h)],n).filter(r=>k.includes(m.default.extname(r).toLowerCase()))}catch(t){return[]}},R=e=>{let t=e.extract.filter(o=>o),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 q=(e={},t={})=>({name:"less-loader",setup:s=>{let o=t.filter;s.onResolve({filter:o||/\.less$/,namespace:"file"},a=>{let n=p.default.resolve(process.cwd(),p.default.relative(process.cwd(),a.resolveDir),a.path);return{path:n,watchFiles:s.initialOptions.watch?[n,...f(n)]:void 0}}),s.onLoad({filter:o||/\.less$/,namespace:"file"},async a=>{let n=await y.promises.readFile(a.path,"utf-8"),i=p.default.dirname(a.path),u=p.default.basename(a.path);try{return{contents:(await C.default.render(n,v(L({filename:u,rootpath:i},e),{paths:[...e.paths||[],i]}))).css,loader:"css",resolveDir:i}}catch(r){return{errors:[R(r)],resolveDir:i}}})}});0&&(module.exports={lessLoader}); |
{ | ||
"name": "esbuild-plugin-less", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "esbuild plugin for less files", | ||
@@ -22,3 +22,2 @@ "repository": "https://github.com/iam-medvedev/esbuild-plugin-less.git", | ||
"commit": "yarn git-cz", | ||
"prepublish": "yarn test && yarn types && yarn build", | ||
"types": "NODE_ENV=production tsc --emitDeclarationOnly --declaration --outDir build", | ||
@@ -45,3 +44,3 @@ "test": "jest" | ||
"cz-conventional-changelog": "^3.3.0", | ||
"esbuild": "^0.12.5", | ||
"esbuild": "^0.13.1", | ||
"git-cz": "^4.7.6", | ||
@@ -58,3 +57,3 @@ "husky": "^6.0.0", | ||
"peerDependencies": { | ||
"esbuild": "^0.12.x" | ||
"esbuild": "^0.13.x" | ||
}, | ||
@@ -61,0 +60,0 @@ "dependencies": { |
9612
5
17