esbuild-plugin-less
Advanced tools
Comparing version
@@ -1,1 +0,1 @@ | ||
var m=Object.create,o=Object.defineProperty,f=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=Object.getOwnPropertyNames,h=Object.getOwnPropertyDescriptor;var l=s=>o(s,"__esModule",{value:!0});var v=(s,e)=>{l(s);for(var t in e)o(s,t,{get:e[t],enumerable:!0})},w=(s,e,t)=>{if(l(s),e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!u.call(s,r)&&r!=="default"&&o(s,r,{get:()=>e[r],enumerable:!(t=h(e,r))||t.enumerable});return s},n=s=>s&&s.__esModule?s:w(o(s!=null?m(f(s)):{},"default",{value:s,enumerable:!0}),s);v(exports,{lessLoader:()=>L});var a=n(require("path")),p=n(require("fs")),i=n(require("less")),c="less";function L(s={}){return{name:"less-loader",setup:e=>{e.onResolve({filter:/\.less$/},t=>({path:a.resolve(process.cwd(),a.relative(process.cwd(),t.resolveDir),t.path),namespace:c})),e.onLoad({filter:/.*/,namespace:c},async t=>{let r=await p.promises.readFile(t.path,"utf-8");return{contents:(await i.default.render(r,s)).css,loader:"css"}})}}} | ||
var h=Object.create,a=Object.defineProperty,d=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,u=Object.getOwnPropertyNames,v=Object.getOwnPropertyDescriptor;var p=s=>a(s,"__esModule",{value:!0});var w=(s,e)=>{p(s);for(var t in e)a(s,t,{get:e[t],enumerable:!0})},L=(s,e,t)=>{if(p(s),e&&typeof e=="object"||typeof e=="function")for(let r of u(e))!f.call(s,r)&&r!=="default"&&a(s,r,{get:()=>e[r],enumerable:!(t=v(e,r))||t.enumerable});return s},n=s=>s&&s.__esModule?s:L(a(s!=null?h(d(s)):{},"default",{value:s,enumerable:!0}),s);w(exports,{lessLoader:()=>P});var o=n(require("path")),l=n(require("fs")),i=n(require("less")),c="less";function P(s={}){return{name:"less-loader",setup:e=>{e.onResolve({filter:/\.less$/},t=>({path:o.resolve(process.cwd(),o.relative(process.cwd(),t.resolveDir),t.path),namespace:c})),e.onLoad({filter:/.*/,namespace:c},async t=>{let r=await l.promises.readFile(t.path,"utf-8"),m=o.dirname(t.path);return{contents:(await i.default.render(r,{...s,paths:[...s.paths||[],m]})).css,loader:"css"}})}}} |
@@ -1,1 +0,1 @@ | ||
import{relative as a,resolve as n}from"path";import{promises as l}from"fs";import p from"less";var t="less";function i(r={}){return{name:"less-loader",setup:e=>{e.onResolve({filter:/\.less$/},s=>({path:n(process.cwd(),a(process.cwd(),s.resolveDir),s.path),namespace:t})),e.onLoad({filter:/.*/,namespace:t},async s=>{let o=await l.readFile(s.path,"utf-8");return{contents:(await p.render(o,r)).css,loader:"css"}})}}}export{i as lessLoader}; | ||
import{dirname as n,relative as p,resolve as l}from"path";import{promises as i}from"fs";import c from"less";var r="less";function m(e={}){return{name:"less-loader",setup:t=>{t.onResolve({filter:/\.less$/},s=>({path:l(process.cwd(),p(process.cwd(),s.resolveDir),s.path),namespace:r})),t.onLoad({filter:/.*/,namespace:r},async s=>{let o=await i.readFile(s.path,"utf-8"),a=n(s.path);return{contents:(await c.render(o,{...e,paths:[...e.paths||[],a]})).css,loader:"css"}})}}}export{m as lessLoader}; |
{ | ||
"name": "esbuild-plugin-less", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "esbuild plugin for less files", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/iam-medvedev/esbuild-plugin-less.git", |
@@ -5,2 +5,5 @@ [](http://www.wtfpl.net/about/) | ||
[](https://www.npmjs.com/package/esbuild-plugin-less) | ||
[](https://david-dm.org/iam-medvedev/esbuild-plugin-less) | ||
[](https://codecov.io/gh/iam-medvedev/esbuild-plugin-less) | ||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fiam-medvedev%2Fesbuild-plugin-less?ref=badge_shield) | ||
@@ -39,1 +42,7 @@ # esbuild-plugin-less | ||
`lessLoader` accepts all valid options from less.js. You can find a complete list of options [here](http://lesscss.org/usage/#less-options). | ||
## License | ||
`esbuild-plugin-less` is [WTFPL licensed](./LICENSE). | ||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fiam-medvedev%2Fesbuild-plugin-less?ref=badge_large) |
5433
19.85%46
21.05%