@visulima/rollup-plugin-css 1.0.0-alpha.1 → 1.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +108 -0
- package/LICENSE.md +83 -79
- package/README.md +349 -109
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -0
- package/dist/loaders/less/index.d.ts +17 -9
- package/dist/loaders/less/index.js +1 -0
- package/dist/loaders/lightningcss.d.ts +2 -2
- package/dist/loaders/lightningcss.js +3 -0
- package/dist/loaders/postcss/index.d.ts +2 -2
- package/dist/loaders/postcss/{index.mjs → index.js} +1 -1
- package/dist/loaders/sass/index.d.ts +18 -9
- package/dist/loaders/sass/{index.mjs → index.js} +1 -1
- package/dist/loaders/sourcemap.d.ts +2 -2
- package/dist/loaders/sourcemap.js +1 -0
- package/dist/loaders/stylus/index.d.ts +17 -9
- package/dist/loaders/stylus/index.js +1 -0
- package/dist/loaders/tailwindcss-oxide.d.ts +2 -2
- package/dist/loaders/tailwindcss-oxide.js +1 -0
- package/dist/minifiers/cssnano.d.ts +2 -2
- package/dist/minifiers/lightningcss.d.ts +2 -2
- package/dist/packem_shared/concat-BnU-BO62.js +3 -0
- package/dist/packem_shared/{cssModulesTypesPlugin-B9_bJo_B.mjs → cssModulesTypesPlugin-CjGroK2y.js} +1 -1
- package/dist/packem_shared/generate-js-exports-BhS4eLrN.js +23 -0
- package/dist/packem_shared/getMap-CxaNZNeI.js +1 -0
- package/dist/packem_shared/inferModeOption-9h3Eq6JH.js +1 -0
- package/dist/packem_shared/loadModule-D20jQQNu.js +1 -0
- package/dist/packem_shared/resolve-anj9ucIq.js +1 -0
- package/dist/packem_shared/rollupCssPlugin-CChaHsU3.js +3 -0
- package/dist/packem_shared/{types-BS4hXME3.d.mts → types-CA9pSumu.d.ts} +5 -1
- package/dist/utils/index.d.ts +4 -2
- package/dist/utils/index.js +1 -0
- package/package.json +56 -41
- package/dist/index.d.mts +0 -20
- package/dist/index.mjs +0 -1
- package/dist/loaders/less/index.d.mts +0 -17
- package/dist/loaders/less/index.mjs +0 -1
- package/dist/loaders/lightningcss.d.mts +0 -17
- package/dist/loaders/lightningcss.mjs +0 -3
- package/dist/loaders/postcss/index.d.mts +0 -17
- package/dist/loaders/sass/index.d.mts +0 -18
- package/dist/loaders/sourcemap.d.mts +0 -17
- package/dist/loaders/sourcemap.mjs +0 -1
- package/dist/loaders/stylus/index.d.mts +0 -17
- package/dist/loaders/stylus/index.mjs +0 -1
- package/dist/loaders/tailwindcss-oxide.d.mts +0 -17
- package/dist/loaders/tailwindcss-oxide.mjs +0 -1
- package/dist/minifiers/cssnano.d.mts +0 -17
- package/dist/minifiers/lightningcss.d.mts +0 -17
- package/dist/packem_shared/concat-BbvpVPBg.mjs +0 -3
- package/dist/packem_shared/generate-js-exports-Cg7EXFF1.mjs +0 -14
- package/dist/packem_shared/getMap-BL5hKEnR.mjs +0 -1
- package/dist/packem_shared/inferModeOption-DYyLMRb2.mjs +0 -1
- package/dist/packem_shared/loadModule-CovDETwT.mjs +0 -1
- package/dist/packem_shared/resolve-nqhcPNJ9.mjs +0 -1
- package/dist/packem_shared/rollupCssPlugin-D-7azn92.mjs +0 -3
- package/dist/packem_shared/types-BS4hXME3.d.ts +0 -185
- package/dist/utils/index.d.mts +0 -71
- package/dist/utils/index.mjs +0 -1
- /package/dist/minifiers/{cssnano.mjs → cssnano.js} +0 -0
- /package/dist/minifiers/{lightningcss.mjs → lightningcss.js} +0 -0
- /package/dist/packem_shared/{arrayFmt-Dek5cB7m.mjs → arrayFmt-Dek5cB7m.js} +0 -0
- /package/dist/packem_shared/{ensure-auto-modules-BU3xWEjl.mjs → ensure-auto-modules-BU3xWEjl.js} +0 -0
- /package/dist/packem_shared/{hasModuleSpecifier-DIZeev_W.mjs → hasModuleSpecifier-DIZeev_W.js} +0 -0
- /package/dist/packem_shared/{safeId-BN5akJYJ.mjs → safeId-BN5akJYJ.js} +0 -0
- /package/dist/packem_shared/{sourcemap-DGfgaUBb.mjs → sourcemap-DGfgaUBb.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ke=Object.defineProperty;var d=(t,e)=>ke(t,"name",{value:e,configurable:!0});import Se from"@csstools/postcss-slow-plugins";import{dirname as b,normalize as O,parse as J,resolve as Pe,basename as N,isAbsolute as Oe,join as Ee}from"@visulima/path";import Re from"postcss";import{g as Ie}from"../../packem_shared/generate-js-exports-
|
|
1
|
+
var ke=Object.defineProperty;var d=(t,e)=>ke(t,"name",{value:e,configurable:!0});import Se from"@csstools/postcss-slow-plugins";import{dirname as b,normalize as O,parse as J,resolve as Pe,basename as N,isAbsolute as Oe,join as Ee}from"@visulima/path";import Re from"postcss";import{g as Ie}from"../../packem_shared/generate-js-exports-BhS4eLrN.js";import{H as U,m as C,D as Ce,F as te}from"../../packem_shared/sourcemap-DGfgaUBb.js";import{n as ie}from"../../packem_shared/ensure-auto-modules-BU3xWEjl.js";import{extractICSS as Ne,replaceSymbols as Ue,replaceValueSymbols as Le}from"icss-utils";import{readFile as ze,readFileSync as le}from"@visulima/fs";import{resolve as Q}from"../../packem_shared/resolve-anj9ucIq.js";import{isRelative as De}from"@visulima/path/utils";import{isWhiteSpaceOrCommentNode as G,isSimpleBlockNode as _e,SimpleBlockNode as We,parseListOfComponentValues as Me,isTokenNode as W,isFunctionNode as I,stringify as S}from"@csstools/css-parser-algorithms";import{isTokenOpenParen as qe,TokenType as ae,tokenize as Te,isTokenString as M,isTokenURL as se,isTokenIdent as Fe}from"@csstools/css-tokenizer";import{findMonorepoRoot as Ae,findPackageRoot as Ge}from"@visulima/package";import Xe from"postcss-load-config";import{ensurePCSSPlugins as Be,ensurePCSSOption as q}from"../../packem_shared/inferModeOption-9h3Eq6JH.js";import He from"postcss-modules-extract-imports";import Ve from"postcss-modules-local-by-default";import Je from"postcss-modules-scope";import Qe from"postcss-modules-values";import{makeLegalIdentifier as Ye}from"@rollup/pluginutils";import{getHash as ce}from"@visulima/packem-share/utils";import X from"postcss-value-parser";var Ke=Object.defineProperty,Ze=d((t,e)=>Ke(t,"name",{value:e,configurable:!0}),"i$5");const et=Ze(async(t,e,i,a,s)=>{const o=Q([t,`./${t}`],{baseDirs:[b(e)],caller:"ICSS loader",extensions:i}),r=await ze(o),{messages:l}=await a.process(r,{...s,from:o}),c={};for(const n of l)n.type==="icss"&&Object.assign(c,n.export);return c},"load");var tt=Object.defineProperty,it=d((t,e)=>tt(t,"name",{value:e,configurable:!0}),"t$3");const at=it(async(t,e,i,a,s,o)=>{const r={};for await(const[l,c]of Object.entries(t)){const n=await e(l,i,a,s,o);for(const[p,m]of Object.entries(c))r[p]=n[m]}return r},"resolve");var st=Object.defineProperty,ot=d((t,e)=>st(t,"name",{value:e,configurable:!0}),"c$5");const T="styles-icss",nt=[".css",".pcss",".postcss",".sss"],me=ot(t=>{const e=t?.load??et,i=t?.extensions??nt;return{async OnceExit(a,{result:s}){if(!a.source?.input.file)return;const o={...s.opts,map:void 0},{icssExports:r,icssImports:l}=Ne(a),c=await at(l,e,a.source.input.file,i,s.processor,o);Ue(a,c);for(const[n,p]of Object.entries(r))s.messages.push({export:{[n]:Le(p,c)},plugin:T,type:"icss"});for(const n of Object.keys(l))s.messages.push({import:n,plugin:T,type:"icss-dependency"})},postcssPlugin:T}},"plugin");me.postcss=!0;var rt=Object.defineProperty,pt=d((t,e)=>rt(t,"name",{value:e,configurable:!0}),"t$2");const B=pt((t,e,i,a)=>{const s=[];if(t!==void 0){let o="layer";t&&(o=`layer(${t})`),s.push(o)}return i!==void 0&&s.push(`supports(${i})`),a!==void 0&&s.push(`scope(${a})`),e!==void 0&&s.push(e),s.join(" ")},"formatImportPrelude");var lt=Object.defineProperty,ct=d((t,e)=>lt(t,"name",{value:e,configurable:!0}),"p$7");const mt=ct((t,e)=>{e.reverse();const i=e.pop();if(!i)return t;let a=`${t} ${B(i.layer,i.media,i.supports,i.scope)}`;for(const s of e)a=`'data:text/css;base64,${Buffer.from(`@import ${a}`).toString("base64")}' ${B(s.layer,s.media,s.supports,s.scope)}`;return a},"base64EncodedConditionalImport");var ut=Object.defineProperty,z=d((t,e)=>ut(t,"name",{value:e,configurable:!0}),"e$1");const dt=z(t=>t.type==="warning","isWarning"),H=z(t=>t.type==="nodes","isNodesStatement"),L=z(t=>t.type==="import","isImportStatement"),ft=z(t=>t.type==="pre-import","isPreImportStatement");var gt=Object.defineProperty,ht=d((t,e)=>gt(t,"name",{value:e,configurable:!0}),"u$2");const xt=ht((t,e)=>{t.statements.forEach((i,a)=>{if(dt(i)||ft(i)||i.conditions.length===0)return;if(L(i)){i.node.params=mt(i.fullUri,i.conditions);return}const{nodes:s}=i;if(s.length===0)return;const{parent:o}=s[0];if(!o)return;const r=[];for(const n of i.conditions){if(n.media!==void 0){const p=e({name:"media",params:n.media,source:i.importingNode?.source??o.source});r.push(p)}if(n.scope!==void 0){const p=e({name:"scope",params:n.scope,source:i.importingNode?.source??o.source});r.push(p)}if(n.supports!==void 0){const p=e({name:"supports",params:`(${n.supports})`,source:i.importingNode?.source??o.source});r.push(p)}if(n.layer!==void 0){const p=e({name:"layer",params:n.layer,source:i.importingNode?.source??o.source});r.push(p)}}const l=r[0];if(!l)return;for(let n=0;n<r.length-1;n++)r[n].append(r[n+1]);const c=r.at(-1);o.insertBefore(s[0],l),s.forEach(n=>{n.parent=void 0}),c.append(s),t.statements[a]={conditions:i.conditions,from:i.from,importingNode:i.importingNode,nodes:[l],type:"nodes"}})},"applyConditions");var vt=Object.defineProperty,yt=d((t,e)=>vt(t,"name",{value:e,configurable:!0}),"r$4");const bt=yt(t=>{t.statements.forEach((e,i)=>{if(i!==0)if(e.parent!==void 0){const{before:a}=e.parent.node.raws;H(e)?e.nodes[0].raws.before=a:e.node.raws.before=a}else H(e)&&(e.nodes[0].raws.before=e.nodes[0].raws.before??`
|
|
2
2
|
`)})},"applyRaws");var wt=Object.defineProperty,$t=d((t,e)=>wt(t,"name",{value:e,configurable:!0}),"t$1");const jt=$t((t,e)=>{e.nodes=[],t.charset&&(t.charset.parent=void 0,e.append(t.charset)),t.statements.forEach(i=>{L(i)?(i.node.parent=void 0,e.append(i.node)):H(i)&&i.nodes.forEach(a=>{a.parent=void 0,e.append(a)})})},"applyStyles");var kt=Object.defineProperty,St=d((t,e)=>kt(t,"name",{value:e,configurable:!0}),"o$3");const Pt=St((t,e,i)=>{const a={baseDirs:[e],caller:"@import resolver",extensions:i},s=new URL(t,"file://").pathname,o=[s];return(De(s)||s.startsWith("/"))&&o.push(`.${s}`),s.startsWith("/")&&o.push(s.slice(1)),Q(o,a)},"importResolve");var Ot=Object.defineProperty,ue=d((t,e)=>Ot(t,"name",{value:e,configurable:!0}),"e");const Et=/^data:text\/css(?:;(?:base64|plain))?,/i,Rt=/^data:text\/css;base64,/i,It=/^data:text\/css;plain,/i,V=ue(t=>t!==void 0&&Et.test(t),"isValidDataURL"),Ct=ue(t=>Rt.test(t)?Buffer.from(t.slice(21),"base64").toString():It.test(t)?decodeURIComponent(t.slice(20)):decodeURIComponent(t.slice(14)),"dataURLContents");var Nt=Object.defineProperty,oe=d((t,e)=>Nt(t,"name",{value:e,configurable:!0}),"o$1");const Y=oe(()=>({postcssPlugin:"css-noop",prepare:oe(()=>({}),"prepare")}),"postcssNoop");Y.postcss=!0;var Ut=Object.defineProperty,de=d((t,e)=>Ut(t,"name",{value:e,configurable:!0}),"a$3");const fe=de(async(t,e,i,a,s,o)=>(o===void 0&&(o=0),a.length===0&&a.push(Y()),await t(a).process(e,{from:i,parser:s[o]}).catch(async r=>{if(o++,o===s.length)throw r;return await fe(t,e,i,a,s,o)})),"runPostcss"),Lt=de(async(t,e,i,a,s)=>{const{plugins:o}=a,r=[];return t.opts.syntax?.parse&&r.push(t.opts.syntax.parse),t.opts.parser&&r.push(t.opts.parser),r.push(void 0),await fe(s,e,i,o,r)},"processContent"),zt=/^charset$/i,ge=/^import$/i,Dt=/^url$/i,E=/^layer$/i,_t=/^supports$/i,Wt=/^scope$/i;var Mt=Object.defineProperty,K=d((t,e)=>Mt(t,"name",{value:e,configurable:!0}),"a$2");const qt=K(t=>{for(let e=0;e<t.length;e++){const i=t[e];if(!G(i)&&_e(i)&&qe(i.startToken))return t}return[new We([ae.OpenParen,"(",-1,-1,void 0],[ae.CloseParen,")",-1,-1,void 0],t)]},"wrapInParenthesisIfNeeded"),ne=K(t=>{if(t.startsWith("#"))return"";if(!t.includes("#"))return t;try{const e=new URL(t,"http://example.com");return e.hash?t.slice(0,t.length-e.hash.length):t}catch{return t}},"stripHash"),Tt=K(t=>{const e=Te({css:t});if(e.length===2&&(M(e[0])||se(e[0]))){let n=e[0][4].value;return n=ne(n),n?{fullUri:e[0][1],uri:n}:!1}const i=Me(e);let a="",s="",o,r,l,c;for(let n=0;n<i.length;n++){const p=i[n];if(!G(p)){if(W(p)&&(M(p.value)||se(p.value))){if(a)return!1;a=p.value[4].value,s=p.value[1];continue}if(I(p)&&Dt.test(p.getName())){if(a)return!1;for(let m=0;m<p.value.length;m++){const u=p.value[m];if(!G(u)){if(!a&&W(u)&&M(u.value)){a=u.value[4].value,s=S([[p]]);continue}return!1}}continue}if(!a)return!1;if(W(p)&&Fe(p.value)&&E.test(p.value[4].value)){if(o!==void 0||l!==void 0)return!1;o="";continue}if(I(p)&&E.test(p.getName())){if(o!==void 0||l!==void 0)return!1;o=S([p.value]);continue}if(I(p)&&_t.test(p.getName())){if(l!==void 0)return!1;l=S([p.value]);continue}if(I(p)&&Wt.test(p.getName())){if(c!==void 0)return!1;c=S([qt(p.value)]);continue}r=S([i.slice(n)]);break}}return a=ne(a),a?{fullUri:s,layer:o,media:r,scope:c,supports:l,uri:a}:!1},"parseAtImport");var Ft=Object.defineProperty,k=d((t,e)=>Ft(t,"name",{value:e,configurable:!0}),"l$2");const he=k((t,e,i,a)=>{const s=[];let o=e;const r=t.length;for(o;o<r;o++){const l=t[o];if(s.push(l),t[o+1]?.type!=="comment")break}return[o,{conditions:[],from:a,importingNode:i,nodes:s,type:"nodes"}]},"consumeComments"),At=k((t,e,i,a,s)=>{const o=Tt(e.params);if(!o)return t.warn(`Invalid @import statement in '${e.toString()}'`,{node:e});const r={conditions:[...a],from:s,fullUri:o.fullUri,importingNode:i,node:e,type:"import",uri:o.uri};return(o.layer!==void 0||o.media!==void 0||o.supports!==void 0||o.scope!==void 0)&&r.conditions.push({layer:o.layer,media:o.media,scope:o.scope,supports:o.supports}),r},"parseImport"),Gt=k((t,e,i,a,s,o)=>{const r=[];let l=a;const c=e.length;for(l;l<c;l++){const n=e[l];if(n.type==="comment"){const[p,m]=he(e,l,s,o);r.push(m),l=p;continue}if(n.type==="atrule"&&ge.test(n.name)){r.push(At(t,n,s,i,o));continue}break}return[l-1,r]},"consumeImports"),Xt=k((t,e,i,a,s)=>{const o=[];let r=i;const l=t.length;for(r;r<l;r++){const c=t[r];o.push(c);const n=t[r+1];if(!(n&&n.type==="atrule"&&E.test(n.name)&&!n.nodes))break}return[r,{conditions:[...e],from:s,importingNode:a,nodes:o,type:"nodes"}]},"consumeLayers"),Bt=k((t,e,i,a,s)=>{const o=[];let r=i;const l=t.length;for(r;r<l;r++){const c=t[r];if(c.type==="comment"){const[n,p]=he(t,r,a,s);o.push(p),r=n;continue}if(c.type==="atrule"&&E.test(c.name)&&!c.nodes)if(e.length>0){o.push({conditions:[...e],from:s,importingNode:a,node:c,type:"pre-import"});continue}else{const[n,p]=Xt(t,e,r,a,s);o.push(p),r=n;continue}break}return[r-1,o]},"consumeBeforeImports"),xe=k((t,e,i,a,s)=>{const o={statements:[]};if(e.type==="document")return e.each(m=>{const u=xe(t,m,i,a,s);if(o.charset&&u.charset&&o.charset.params.toLowerCase()!==u.charset.params.toLowerCase())throw u.charset.error(`Incompatible @charset statements:
|
|
3
3
|
${u.charset.params} specified in ${u.charset.source?.input.file}
|
|
4
4
|
${o.charset.params} specified in ${o.charset.source?.input.file}`);!o.charset&&u.charset&&(o.charset=u.charset),o.statements.push(...u.statements)}),o;let r,l=[],c=[],n;for(let m=0;m<e.nodes.length;m++){const u=e.nodes[m];if(m===0&&u.type==="atrule"&&zt.test(u.name)){r=u;continue}if(c.length===0&&(u.type==="comment"||u.type==="atrule"&&E.test(u.name)&&!u.nodes)){[m,l]=Bt(e.nodes,a,m,i,s);continue}if(c.length===0&&u.type==="atrule"&&ge.test(u.name)){[m,c]=Gt(t,e.nodes,a,m,i,s);continue}n={conditions:[...a],from:s,importingNode:i,nodes:e.nodes.slice(m),type:"nodes"};break}const p=[];return l.length>0&&p.push(...l),c.length>0&&p.push(...c),n&&p.push(n),{charset:r,statements:p}},"parseStylesheet");var Ht=Object.defineProperty,D=d((t,e)=>Ht(t,"name",{value:e,configurable:!0}),"h");const Vt=/^(?:[a-z]+:)?\/\//i,Jt=D(t=>{if(Vt.test(t))return!1;try{if(new URL(t,"https://example.com").search)return!1}catch{}return!0},"isProcessableURL"),re=D(async(t,e,i,a,s,o)=>{const{conditions:r,from:l,node:c}=e,n=r.map(f=>B(f.layer,f.media,f.supports,f.scope)).join(":");if(a.skipDuplicates){if(s.importedFiles[i]?.[n])return{statements:[]};s.importedFiles[i]||(s.importedFiles[i]={}),s.importedFiles[i][n]=!0}if(l.includes(i))return{statements:[]};const p=await a.load(i,a);if(p.trim()===""&&a.warnOnEmpty)return t.warn(`${i} is empty`,{node:c}),{statements:[]};if(a.skipDuplicates&&s.hashFiles[p]?.[n])return{statements:[]};const m=await Lt(t,p,i,a,o),u=m.root;return a.debug&&u.append({text:i}),t.messages=[...t.messages,...m.messages],a.skipDuplicates&&(u.some(f=>f.type==="atrule"&&f.name==="import")||(s.hashFiles[p]||(s.hashFiles[p]={}),s.hashFiles[p][n]=!0)),await ve(a,t,u,s,c,r,[...l,i],o)},"loadImportContent"),Qt=D(async(t,e,i,a,s)=>{if(V(i.uri)){i.stylesheet=await re(e,i,i.uri,t,a,s);return}if(V(i.from.at(-1))){i.stylesheet={statements:[]},e.warn(`Unable to import '${i.uri}' from a stylesheet that is embedded in a data url`,{node:i.node});return}const o=i.node;let r;o.source?.input.file&&(r=o.source.input.file);const l=r?b(r):t.root;for(const[n,p]of Object.entries(t.alias))i.uri!==n&&!i.uri.startsWith(`${n}/`)||(i.uri=O(p)+i.uri.slice(n.length));let c;try{c=await t.resolve(i.uri,l,t.extensions,o)}catch{i.node.warn(e,`Unable to resolve "${i.uri}" from "${l}"`);return}e.messages.push({file:c,parent:r,plugin:"packem-postcss-import",type:"dependency"}),i.stylesheet=await re(e,i,c,t,a,s)},"resolveImportId"),ve=D(async(t,e,i,a,s,o,r,l)=>{let{charset:c,statements:n}=xe(e,i,s,o,r);{const p=[];for await(const m of n)!L(m)||!Jt(m.uri)||t.filter&&!t.filter(m.uri)||p.push(Qt(t,e,m,a,l));p.length>0&&await Promise.all(p)}for(let p=0;p<n.length;p++){const m=n[p];if(L(m)&&m.stylesheet){if(c&&m.stylesheet.charset&&c.params.toLowerCase()!==m.stylesheet.charset.params.toLowerCase())throw m.stylesheet.charset.error(`Incompatible @charset statements:
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { c as Loader, e as SassLoaderOptions } from '../../packem_shared/types-CA9pSumu.js';
|
|
2
|
+
export { f as SassLoaderContext } from '../../packem_shared/types-CA9pSumu.js';
|
|
3
|
+
import 'cssnano';
|
|
4
|
+
import 'lightningcss';
|
|
5
|
+
import 'postcss';
|
|
6
|
+
import 'postcss-load-config';
|
|
7
|
+
import 'less';
|
|
8
|
+
import '@visulima/packem-share/types';
|
|
9
|
+
import 'sass';
|
|
10
|
+
import 'sass-embedded';
|
|
11
|
+
import 'stylus';
|
|
12
|
+
import '@visulima/packem-share/utils';
|
|
13
|
+
import 'rollup';
|
|
14
|
+
import 'source-map-js';
|
|
15
|
+
|
|
16
|
+
declare const loader: Loader<SassLoaderOptions>;
|
|
17
|
+
|
|
18
|
+
export { SassLoaderOptions, loader as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var U=Object.defineProperty;var u=(e,t)=>U(e,"name",{value:t,configurable:!0});import{fileURLToPath as g}from"node:url";import{extname as v,dirname as x,join as O,isAbsolute as y}from"@visulima/path";import{readFileSync as A}from"@visulima/fs";import{pathToFileURL as S}from"mlly";import{resolve as D}from"../../packem_shared/resolve-
|
|
1
|
+
var U=Object.defineProperty;var u=(e,t)=>U(e,"name",{value:t,configurable:!0});import{fileURLToPath as g}from"node:url";import{extname as v,dirname as x,join as O,isAbsolute as y}from"@visulima/path";import{readFileSync as A}from"@visulima/fs";import{pathToFileURL as S}from"mlly";import{resolve as D}from"../../packem_shared/resolve-anj9ucIq.js";import{normalizeUrl as L,getUrlOfPartial as j}from"../../packem_shared/hasModuleSpecifier-DIZeev_W.js";import{isWindows as R}from"@visulima/path/utils";var C=Object.defineProperty,k=u((e,t)=>C(e,"name",{value:t,configurable:!0}),"e$1");const $=k(e=>{switch(e.toLowerCase()){case".css":return"css";case".sass":return"indented";case".scss":return"scss";default:return}},"resolveSyntax");var E=Object.defineProperty,F=u((e,t)=>E(e,"name",{value:t,configurable:!0}),"i$1");const M=[".scss",".sass",".css"],T=["sass","style"],W=F((e,t)=>({canonicalize(r,s){const m=s.containingUrl?g(s.containingUrl.toString()):e;let n;const p=L(r),o=j(p);try{n=D([o,p],{baseDirs:[x(m)],caller:"Sass modern importer",extensions:M,mainFields:T})}catch{return null}return new URL(S(n))},load(r){const s=v(r.pathname),m=s?$(s.toLowerCase())??"scss":"scss";try{let n=A(r);return t&&(n=`/* ${r.pathname} */
|
|
2
2
|
${n}`),{contents:n,sourceMapUrl:r,syntax:m}}catch{return null}}}),"importer");var z=Object.defineProperty,H=u((e,t)=>z(e,"name",{value:t,configurable:!0}),"d");const N=H(async e=>{let t;if(e===void 0||e==="sass-embedded")try{t=await import("sass-embedded").then(r=>r.compileString)}catch{}if(t===void 0&&(e===void 0||e==="sass"))try{t=await import("sass").then(r=>r.compileString)}catch{}if(t===void 0)throw new Error("No supported Sass implementation found. Please install 'sass-embedded' or 'sass'.");return r=>{const{data:s,...m}=r;return t(s,m)}},"getSassCompiler");var _=Object.defineProperty,f=u((e,t)=>_(e,"name",{value:t,configurable:!0}),"p$1");const B=f(async(e,t,r,s,m)=>{const{warnRuleAsWarning:n,...p}=r;let o=s;r.additionalData&&(o=typeof r.additionalData=="function"?await r.additionalData(s,e):`${r.additionalData}
|
|
3
3
|
${s}`);const a={...p,data:o};if(!a.logger){const d=n!==!1,b=f(i=>`Warning on line ${i.start.line}, column ${i.start.column} of ${i.url??"-"}:${i.start.line}:${i.start.column}:
|
|
4
4
|
`,"formatSpan"),P=f(i=>`[debug:${i.start.line}:${i.start.column}] `,"formatDebugSpan");a.logger={debug(i,c){let l="";c.span&&(l=P(c.span)),l+=i,t.info({message:l})},warn(i,c){let l="";c.deprecation&&(l+="Deprecation "),c.span&&(l+=b(c.span)),l+=i,c.span?.context&&(l+=`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as Loader } from '../packem_shared/types-
|
|
1
|
+
import { c as Loader } from '../packem_shared/types-CA9pSumu.js';
|
|
2
2
|
import 'cssnano';
|
|
3
3
|
import 'lightningcss';
|
|
4
4
|
import 'postcss';
|
|
@@ -14,4 +14,4 @@ import 'source-map-js';
|
|
|
14
14
|
|
|
15
15
|
declare const loader: Loader;
|
|
16
16
|
|
|
17
|
-
export
|
|
17
|
+
export { loader as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,s as o}from"../packem_shared/sourcemap-DGfgaUBb.js";const p={alwaysProcess:!0,name:"sourcemap",async process({code:a,map:s}){return{code:o(a),map:await e(a,this.id)??s}}};export{p as default};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { c as Loader, g as StylusLoaderOptions } from '../../packem_shared/types-CA9pSumu.js';
|
|
2
|
+
import 'cssnano';
|
|
3
|
+
import 'lightningcss';
|
|
4
|
+
import 'postcss';
|
|
5
|
+
import 'postcss-load-config';
|
|
6
|
+
import 'less';
|
|
7
|
+
import '@visulima/packem-share/types';
|
|
8
|
+
import 'sass';
|
|
9
|
+
import 'sass-embedded';
|
|
10
|
+
import 'stylus';
|
|
11
|
+
import '@visulima/packem-share/utils';
|
|
12
|
+
import 'rollup';
|
|
13
|
+
import 'source-map-js';
|
|
14
|
+
|
|
15
|
+
declare const loader: Loader<StylusLoaderOptions>;
|
|
16
|
+
|
|
17
|
+
export { StylusLoaderOptions, loader as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=Object.defineProperty;var p=(e,t)=>h(e,"name",{value:t,configurable:!0});import{existsSync as y}from"node:fs";import{readFileSync as w}from"@visulima/fs";import{normalize as n,dirname as P,join as m}from"@visulima/path";import S from"stylus";import{m as b}from"../../packem_shared/sourcemap-DGfgaUBb.js";var v=Object.defineProperty,u=p((e,t)=>v(e,"name",{value:t,configurable:!0}),"a");const C=u(async(e,t)=>{if(!(!e.sources||e.sourcesContent))return await Promise.all(e.sources.map(async r=>{const o=n(m(t,r));if(y(o))return w(o)}).filter(Boolean))},"populateSourcemapContent"),F={name:"stylus",async process({code:e,map:t}){const r={...this.options},o=n(P(this.id)),i=[o,m(o,"node_modules"),m(this.cwd,"node_modules")];r.paths&&i.push(...r.paths);const s=S(e,r).set("filename",this.id).set("paths",i).set("sourcemap",{basePath:o,comment:!1});e=await u(async()=>await new Promise((a,l)=>{s.render((c,f)=>c?l(c):a(f))}),"render")();const d=s.deps();for(const a of d)this.deps.add(n(a));return s.sourcemap&&(s.sourcemap.sourcesContent=await C(s.sourcemap,o)),{code:e,map:b(s.sourcemap).toString()??t}},test:/\.(styl|stylus)$/i};export{F as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as Loader } from '../packem_shared/types-
|
|
1
|
+
import { c as Loader } from '../packem_shared/types-CA9pSumu.js';
|
|
2
2
|
import 'cssnano';
|
|
3
3
|
import 'lightningcss';
|
|
4
4
|
import 'postcss';
|
|
@@ -14,4 +14,4 @@ import 'source-map-js';
|
|
|
14
14
|
|
|
15
15
|
declare const tailwindcssLoader: Loader;
|
|
16
16
|
|
|
17
|
-
export
|
|
17
|
+
export { tailwindcssLoader as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var J=Object.defineProperty;var S=(g,a)=>J(g,"name",{value:a,configurable:!0});import{stat as y}from"node:fs/promises";import{compile as P,Features as i,toSourceMap as x,optimize as z}from"@tailwindcss/node";import{clearRequireCache as M}from"@tailwindcss/node/require-cache";import{Scanner as $}from"@tailwindcss/oxide";import{findPackageJson as R}from"@visulima/package";import{resolve as v,dirname as w,relative as E,join as C,normalize as T}from"@visulima/path";import{resolveAlias as F}from"@visulima/path/utils";import{g as U}from"../packem_shared/generate-js-exports-BhS4eLrN.js";import{resolve as A}from"../packem_shared/resolve-anj9ucIq.js";var k=Object.defineProperty,f=S((g,a)=>k(g,"name",{value:a,configurable:!0}),"p");class B{static{S(this,"U")}constructor(a,r,u,l,s,n){this.id=a,this.base=r,this.enableSourceMaps=u,this.customCssResolver=l,this.customJsResolver=s,this.logger=n}static{f(this,"TailwindRoot")}compiler;scanner;candidates=new Set;buildDependencies=new Map;async generate(a,r){const u=v(this.id.replace(/\?.*$/u,"")),l=f(e=>{e!==u&&(/[#?].*\.svg$/u.test(e)||r(e))},"addWatchFileWrapper"),s=this.requiresBuild(),n=w(v(u));if(!this.compiler||!this.scanner||await s){M([...this.buildDependencies.keys()]),this.buildDependencies.clear(),this.addBuildDependency(u),this.logger.debug({message:"Setup compiler"});const e=[];this.compiler=await P(a,{base:n,customCssResolver:this.customCssResolver,customJsResolver:this.customJsResolver,from:this.enableSourceMaps?this.id:void 0,onDependency:f(m=>{l(m),e.push(this.addBuildDependency(m))},"onDependency"),shouldRewriteUrls:!0}),await Promise.all(e),this.logger.debug({message:"Setup scanner"});const d=[...this.compiler.root==="none"?[]:this.compiler.root===null?[{base:this.base,negated:!1,pattern:"**/*"}]:[{...this.compiler.root,negated:!1}],...this.compiler.sources];this.scanner=new $({sources:d})}else for(const e of this.buildDependencies.keys())l(e);const t=this.compiler.features&(i.AtApply|i.JsPluginCompat|i.ThemeFunction|i.Utilities);if(this.logger.debug({data:{availableFeatures:this.compiler.features,hasAtApply:!!(this.compiler.features&i.AtApply),hasJsPluginCompat:!!(this.compiler.features&i.JsPluginCompat),hasRequiredFeatures:!!t,hasThemeFunction:!!(this.compiler.features&i.ThemeFunction),hasUtilities:!!(this.compiler.features&i.Utilities),requiredFeatures:i.AtApply|i.JsPluginCompat|i.ThemeFunction|i.Utilities},message:"Feature analysis"}),!t)return this.logger.debug({data:{missingFeatures:{AtApply:!(this.compiler.features&i.AtApply),JsPluginCompat:!(this.compiler.features&i.JsPluginCompat),ThemeFunction:!(this.compiler.features&i.ThemeFunction),Utilities:!(this.compiler.features&i.Utilities)}},message:"Missing required features, returning false"}),!1;if(this.compiler.features&i.Utilities)if(this.logger.debug({data:{candidatesCountBefore:this.candidates.size,scannerExists:!!this.scanner,scannerHasScan:!!(this.scanner&&typeof this.scanner.scan=="function")},message:"Scan for candidates - Utilities feature enabled"}),this.scanner){const e=this.scanner.scan();this.logger.debug({data:{scannedCandidates:e.slice(0,10),scannedCandidatesCount:e.length},message:"Scanner results"});for(const d of e)this.candidates.add(d);this.logger.debug({data:{candidatesCountAfter:this.candidates.size,newCandidatesAdded:e.length},message:"Candidates updated"})}else this.logger.debug({data:{hasScanMethod:!!(this.scanner&&typeof this.scanner.scan=="function"),scannerType:typeof this.scanner},message:"Scanner not available or missing scan method"});else this.logger.debug({message:"Utilities feature not enabled, skipping candidate scanning"});if(this.compiler.features&i.Utilities){if(this.scanner&&this.scanner.files){this.logger.debug({data:{files:this.scanner.files.slice(0,5),filesCount:this.scanner.files.length},message:"Watching individual files from scanner"});for(const e of this.scanner.files)l(e)}else this.logger.debug({message:"No individual files to watch from scanner"});if(this.scanner&&this.scanner.globs){this.logger.debug({data:{globs:this.scanner.globs.slice(0,3),globsCount:this.scanner.globs.length},message:"Processing globs from scanner"});for await(const e of this.scanner.globs){if(e.pattern[0]==="!"){this.logger.debug({data:{pattern:e.pattern},message:"Skipping negated glob pattern"});continue}let d=E(this.base,e.base);d[0]!=="."&&(d=`./${d}`);const m=C(d,e.pattern);this.logger.debug({data:{base:e.base,glob:e.pattern,watchPath:m},message:"Adding glob to watch list"}),l(m);const{root:b}=this.compiler;if(b!=="none"&&b!==null){const p=v(b.base,b.pattern);try{const h=await y(p);if(h.isDirectory())this.logger.debug({data:{basePath:p,isDirectory:h.isDirectory()},message:"Valid source directory confirmed"});else{const D=`The path given to \`source(…)\` must be a directory but got \`source(${p})\` instead.`;throw this.logger.debug({data:{basePath:p,error:D,isDirectory:h.isDirectory()},message:"Invalid source path detected"}),new Error(D)}}catch(h){this.logger.debug({data:{basePath:p,error:h instanceof Error?h.message:String(h)},message:"Error checking source directory"})}}}}else this.logger.debug({message:"No globs to process from scanner"})}else this.logger.debug({message:"Utilities feature not enabled, skipping file watching"});this.logger.debug({data:{candidates:[...this.candidates].slice(0,10),candidatesCount:this.candidates.size},message:"Build CSS"});const o=this.compiler.build([...this.candidates]);this.logger.debug({data:{cssLength:o.length,cssPreview:o.slice(0,200)+(o.length>200?"...":"")},message:"CSS build completed"}),this.logger.debug({data:{enableSourceMaps:this.enableSourceMaps},message:"Build Source Map"});const c=(this.enableSourceMaps?x(this.compiler.buildSourceMap()):void 0)?.raw;return c?this.logger.debug({data:{hasMappings:!!c.mappings,mapSize:JSON.stringify(c).length,sourcesCount:c.sources?.length||0},message:"Source map generated"}):this.logger.debug({message:"No source map generated"}),{code:o,map:c}}async addBuildDependency(a){let r;try{r=(await y(a)).mtimeMs}catch{}this.buildDependencies.set(a,r)}async requiresBuild(){for await(const[a,r]of this.buildDependencies){if(r===void 0)return!0;try{if((await y(a)).mtimeMs>r)return!0}catch{return!0}}return!1}}const V={name:"tailwindcss",async process({code:g,map:a}){const r=this.alias,u=f(async(t,o)=>{try{const c=await R(o),e=A([t,F(t,r??{})],{baseDirs:[o,C(w(c.path),"node_modules")],caller:"Tailwind CSS Resolver",conditionNames:["style","development|production"],extensions:[".css"],mainFields:["style"],preferRelative:!0});if(e)return this.logger.debug({message:`Resolved CSS import: ${t} -> ${e}`}),e}catch{}return this.logger.debug({message:`Failed to resolve CSS import: ${t} from ${o}`}),!1},"customCssResolver"),l=f(async(t,o)=>{try{const c=await R(o),e=A([t,F(t,r??{})],{baseDirs:[o,C(w(c.path),"node_modules")],caller:"Tailwind JS Resolver",extensions:[".js",".mjs",".cjs",".ts",".tsx",".jsx"]});if(e)return this.logger.debug({message:`Resolved JS import: ${t} -> ${e}`}),e}catch{}return this.logger.debug({message:`Failed to resolve JS import: ${t} from ${o}`}),!1},"customJsResolver");let s=await new B(this.id,this.sourceDir||process.cwd(),this.useSourcemap,u,l,this.logger).generate(g,t=>this.deps.add(T(t)));if(!s)return this.logger.debug({data:{returningOriginalContent:!0},message:"Tailwind generation returned false - not a Tailwind file or missing features"}),{code:g,map:a};if(this.logger.debug({message:"[@tailwindcss/rollup] Generate CSS"}),this.environment==="production"){this.logger.debug({data:{minify:!0,originalSize:s.code.length},message:"[@tailwindcss/rollup] Optimize CSS"});const t=z(s.code,{file:this.id,map:s.map,minify:!0});this.logger.debug({data:{optimizedSize:t.code.length,originalSize:s.code.length,sizeReduction:s.code.length-t.code.length,sizeReductionPercent:`${((s.code.length-t.code.length)/s.code.length*100).toFixed(2)}%`},message:"CSS optimization completed"}),s=t}else this.logger.debug({data:{environment:this.environment},message:"Development mode - skipping CSS optimization"});if(this.emit)return{...s,meta:{moduleContents:s,types:void 0},moduleSideEffects:!0};const n=U({css:s.code,cwd:this.cwd,dts:this.dts,emit:this.emit,extract:this.extract,icssDependencies:[],id:this.id,inject:this.inject,logger:this.logger,map:s.map,modulesExports:{},namedExports:this.namedExports,supportModules:!1});return this.extract?{code:n.code,extracted:{css:s.code,id:this.id,map:s.map},map:n.map,meta:n.meta,moduleSideEffects:n.moduleSideEffects}:{code:n.code,map:n.map,meta:n.meta,moduleSideEffects:n.moduleSideEffects}},test:/\.css$/i};export{V as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Options } from 'cssnano';
|
|
2
|
-
import { M as Minifier } from '../packem_shared/types-
|
|
2
|
+
import { M as Minifier } from '../packem_shared/types-CA9pSumu.js';
|
|
3
3
|
import 'lightningcss';
|
|
4
4
|
import 'postcss';
|
|
5
5
|
import 'postcss-load-config';
|
|
@@ -14,4 +14,4 @@ import 'source-map-js';
|
|
|
14
14
|
|
|
15
15
|
declare const cssnanoMinifier: Minifier<Options>;
|
|
16
16
|
|
|
17
|
-
export
|
|
17
|
+
export { cssnanoMinifier as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Minifier, a as InternalStyleOptions } from '../packem_shared/types-
|
|
1
|
+
import { M as Minifier, a as InternalStyleOptions } from '../packem_shared/types-CA9pSumu.js';
|
|
2
2
|
import 'cssnano';
|
|
3
3
|
import 'lightningcss';
|
|
4
4
|
import 'postcss';
|
|
@@ -14,4 +14,4 @@ import 'source-map-js';
|
|
|
14
14
|
|
|
15
15
|
declare const lightningcssMinifier: Minifier<NonNullable<InternalStyleOptions["lightningcss"]>>;
|
|
16
16
|
|
|
17
|
-
export
|
|
17
|
+
export { lightningcssMinifier as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var l=Object.defineProperty;var u=(o,n)=>l(o,"name",{value:n,configurable:!0});import{SourceMapGenerator as p}from"source-map-js";import{m as f}from"./sourcemap-DGfgaUBb.js";var g=Object.defineProperty,d=u((o,n)=>g(o,"name",{value:n,configurable:!0}),"u");const j=d(async o=>{const n=new p({file:""}),a=[];let c=0;for await(const{css:i,map:m}of o){a.push(i);const s=f(m),t=s.toObject();if(!t)continue;const r=s.toConsumer();if(r){if(r.eachMapping(e=>{n.addMapping({generated:{column:e.generatedColumn,line:c+e.generatedLine},name:e.name,original:{column:e.originalColumn,line:e.originalLine},source:e.source})}),t.sourcesContent)for(const e of t.sources)n.setSourceContent(e,r.sourceContentFor(e,!0));c+=i.split(`
|
|
2
|
+
`).length}}return{css:a.join(`
|
|
3
|
+
`),map:n}},"concat");export{j as default};
|
package/dist/packem_shared/{cssModulesTypesPlugin-B9_bJo_B.mjs → cssModulesTypesPlugin-CjGroK2y.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var a=Object.defineProperty;var c=(s,e)=>a(s,"name",{value:e,configurable:!0});import{isAccessible as r,writeFile as m}from"@visulima/fs";import{normalize as p}from"@visulima/path";import{n as l}from"./ensure-auto-modules-BU3xWEjl.
|
|
1
|
+
var a=Object.defineProperty;var c=(s,e)=>a(s,"name",{value:e,configurable:!0});import{isAccessible as r,writeFile as m}from"@visulima/fs";import{normalize as p}from"@visulima/path";import{n as l}from"./ensure-auto-modules-BU3xWEjl.js";var u=Object.defineProperty,d=c((s,e)=>u(s,"name",{value:e,configurable:!0}),"u");const g=`
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/* prettier-ignore */
|
|
4
4
|
// @ts-nocheck
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var G=Object.defineProperty;var C=(r,s)=>G(r,"name",{value:s,configurable:!0});import{relative as V,basename as P}from"@visulima/path";import R from"./safeId-BN5akJYJ.js";var W=Object.defineProperty,w=C((r,s)=>W(r,"name",{value:s,configurable:!0}),"j");const d="css",F=new Set(["abstract","arguments","await","boolean","break","byte","case","catch","char","class","const","continue",d,"debugger","default","delete","do","double","else","enum","eval","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","let","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with","yield"]),D=w(r=>{const s=r.replaceAll(/[^\w$]/g,"_");return F.has(s)?`_${s}`:s},"getClassNameIdentifier"),H=w(({css:r,cssVariableName:s,cwd:l,dts:y,dtsOutput:m,id:j,logger:c,modulesExports:e,modulesVariableName:b,namedExports:$,supportModules:g})=>{const o=[`var ${s} = ${JSON.stringify(r)};`];if($&&Object.keys(e).length>0){const u=typeof $=="function"?$:D;for(const[h,a]of Object.entries(e)){const t=u(h);if(h!==t&&c){const v=l?V(l,j):j;c.warn({message:`Exported \`${h}\` as \`${t}\` in ${v}`})}const n=JSON.stringify(a);o.push(`var ${t} = ${n};`),y&&m.push(`declare const ${t}: ${n};`)}}Object.keys(e).length>0&&o.push(`var ${b} = ${JSON.stringify(e)};`);const p=`
|
|
2
|
+
export default ${g?b:s};
|
|
3
|
+
`;return o.push(p),y&&(m.push(`declare const ${s}: string;`),g&&m.push(`
|
|
4
|
+
interface ModulesExports {
|
|
5
|
+
${Object.keys(e).map(u=>` '${u}': string;`).join(`
|
|
6
|
+
`)}
|
|
7
|
+
}
|
|
8
|
+
`,`declare const ${b}: ModulesExports;`),m.push(p)),{code:o.join(`
|
|
9
|
+
`),moduleSideEffects:!1,types:y?m.join(`
|
|
10
|
+
`):void 0}},"generateInlineExports"),T=w(({css:r,cwd:s,dts:l=!1,emit:y=!1,extract:m=!1,icssDependencies:j=[],id:c,inject:e,inline:b=!1,logger:$,map:g,modulesExports:o,namedExports:p,supportModules:u})=>{const h=w(i=>R(i,P(c)),"saferId"),a=h("modules"),t=[`var ${d} = ${JSON.stringify(r)};`],n=[],v=[d];if(p){l&&n.push(`declare const ${d}: string;`);const i=typeof p=="function"?p:D;for(const[x,O]of Object.entries(o)){const f=i(x);if(x!==f&&$){const S=s?V(s,c):c;$.warn({message:`Exported \`${x}\` as \`${f}\` in ${S}`})}const E=JSON.stringify(O);t.push(`var ${f} = ${E};`),l&&n.push(`declare const ${f}: ${E};`),v.push(f)}}if(b)return H({css:r,cssVariableName:d,cwd:s,dts:l,dtsOutput:n,id:c,logger:$,modulesExports:o,modulesVariableName:a,namedExports:p,supportModules:u});if(e)if(typeof e=="function")t.push(e(d,c,t),`var ${a} = ${JSON.stringify(o)};`);else{const{treeshakeable:i,...x}=typeof e=="object"?e:{},O=h("injector"),f=`${O}(${d},${JSON.stringify(x)});`,E=typeof e=="object"&&e.package?e.package:"@visulima/css-style-inject",S=typeof e=="object"&&e.method?e.method:"cssStyleInject";if(t.unshift(`import { ${S} as ${O} } from "${E}";`),i||t.push(`var ${a} = ${JSON.stringify(o)};`,f),i){t.push("var injected = false;");const B=`if (!injected) { injected = true; ${f} }`;if(o.inject)throw new Error("`inject` keyword is reserved when using `inject.treeshakeable` option");let k="";for(const[_,z]of Object.entries(o)){const A=JSON.stringify(_),q=JSON.stringify(z);k+=`get ${A}() { ${B} return ${q}; },
|
|
11
|
+
`}k+=`inject: function inject() { ${B} },`,t.push(`var ${a} = {${k}};`)}}!e&&Object.keys(o).length>0&&t.push(`var ${a} = ${JSON.stringify(o)};`);const J=`
|
|
12
|
+
export default ${u?a:d};
|
|
13
|
+
`;if(t.push(J),l&&(u&&n.push(`
|
|
14
|
+
interface ModulesExports {
|
|
15
|
+
${Object.keys(o).map(i=>` '${i}': string;`).join(`
|
|
16
|
+
`)}
|
|
17
|
+
}
|
|
18
|
+
`,typeof e=="object"&&e.treeshakeable?"interface ModulesExports {inject:()=>void}":"",`declare const ${a}: ModulesExports;`),n.push(J)),p){const i=`export {
|
|
19
|
+
${v.filter(Boolean).join(`,
|
|
20
|
+
`)}
|
|
21
|
+
};`;t.push(i),l&&n.push(i)}const N=t.filter(Boolean).join(`
|
|
22
|
+
`),M=n.length>0?n.filter(Boolean).join(`
|
|
23
|
+
`):void 0;if(y)return{code:r,map:g,meta:{icssDependencies:j,moduleContents:N,types:void 0},moduleSideEffects:!0};let I;return m&&(I={css:r,id:c,map:g}),{code:N,extracted:I,map:g,meta:{icssDependencies:j,moduleContents:N,types:M},moduleSideEffects:u||typeof e=="object"&&e.treeshakeable?!1:"no-treeshake",types:M}},"generateJsExports");export{T as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"@visulima/fs";import"@visulima/path";import"source-map-js";import{g as o,m as s,s as i}from"./sourcemap-DGfgaUBb.js";export{o as getMap,s as mm,i as stripMap};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var l=(n,r)=>f(n,"name",{value:r,configurable:!0});import p from"./arrayFmt-Dek5cB7m.js";import d from"./loadModule-D20jQQNu.js";var y=Object.defineProperty,o=l((n,r)=>y(n,"name",{value:r,configurable:!0}),"o");const u=["inject","extract","emit","inline"],S=p(u),P=o(n=>{const r=Array.isArray(n)?n:[n];if(r[0]&&!u.includes(r[0]))throw new Error(`Incorrect mode provided, allowed modes are ${S}`);const t=r[0]??"inject";let e=!1,i=!1;return t==="extract"&&(e=r[1]??!0),t==="inject"&&(i=r[1]??!0),{emit:t==="emit",extract:e,inject:i,inline:t==="inline"}},"inferModeOption"),O=o((n,r)=>typeof n=="boolean"?n&&{}:typeof n=="object"?n:r,"inferOption"),j=o(n=>{const r=Array.isArray(n)?n:[n];return r[0]?{content:!0,...r[1],inline:r[0]==="inline"}:!1},"inferSourceMapOption"),b=o((n,r)=>{const t=O(n,{});return r&&typeof t=="object"&&!t.alias&&(t.alias=r),t},"inferHandlerOption"),a=o(async(n,r,t,e)=>{if(typeof n!="string")return n;const i=await d(n,t,e);if(!i)throw new Error(`Unable to load PostCSS ${r} \`${n}\``);return i},"ensurePCSSOption"),h=o(async(n,r,t)=>{if(n===void 0)return[];if(n.length===0)return[];const e=[];for await(const i of n.filter(Boolean)){if(!Array.isArray(i)){e.push(await a(i,"plugin",r,t));continue}const[s,c]=i;c?e.push((await a(s,"plugin",r,t))(c)):e.push(await a(s,"plugin",r,t))}return e},"ensurePCSSPlugins");export{a as ensurePCSSOption,h as ensurePCSSPlugins,b as inferHandlerOption,P as inferModeOption,O as inferOption,j as inferSourceMapOption};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var n=(e,t)=>d(e,"name",{value:t,configurable:!0});import{createRequire as c}from"node:module";import{interopDefault as m,loadModule as f}from"mlly";import{resolve as p}from"./resolve-anj9ucIq.js";var g=Object.defineProperty,u=n((e,t)=>g(e,"name",{value:t,configurable:!0}),"a");const o={},R=[".js",".mjs",".cjs",".json"],y=u(async(e,t)=>{try{return t(e)}catch(r){const s=r;if(s.code==="ERR_REQUIRE_ESM")return m(await f(e));throw s}},"loadModuleFromPath"),E=u(async(e,t,r)=>{if(o[e])return o[e];if(o[e]===null)return;const s={baseDirs:[t],caller:"Module loader",extensions:R,symlinks:!1},i=c(import.meta.url);try{const a=p([e,`./${e}`],s);if(a.startsWith("data:")){r.warn({message:`Skipping data URL module: ${e}`,module:e,plugin:"css"}),o[e]=null;return}o[e]=await y(a,i)}catch(a){r.warn({message:`Failed to resolve or load module: ${a instanceof Error?a.message:String(a)}`,module:e,plugin:"css"}),o[e]=null;return}const l=o[e];return l?.default??l},"loadModule");export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var i=(o,e)=>a(o,"name",{value:e,configurable:!0});import{fileURLToPath as m}from"node:url";import{dirname as f}from"@visulima/path";import{ResolverFactory as x}from"oxc-resolver";import d from"./arrayFmt-Dek5cB7m.js";var u=Object.defineProperty,v=i((o,e)=>u(o,"name",{value:e,configurable:!0}),"l");const b=f(m(import.meta.url)),k=v((o,e)=>{const s={baseDirs:[b],caller:"Resolver",extensions:[".mjs",".js",".cjs",".json"],symlinks:!0,...e},c=new x({extensions:s.extensions,symlinks:s.symlinks});for(const n of s.baseDirs)for(const t of o)try{const{error:r,path:l}=c.sync(n,t);if(l)return l;r&&console.debug(r,{context:[{basedir:n,caller:e.caller,extensions:e.extensions,id:t}]})}catch(r){console.debug(r.message,{context:[{basedir:n,caller:e.caller,error:r,extensions:e.extensions,id:t}]})}throw new Error(`${s.caller} could not resolve ${d(o)}`)},"resolve");export{k as resolve};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var Y=Object.defineProperty;var N=(e,t)=>Y(e,"name",{value:t,configurable:!0});import{createFilter as ee}from"@rollup/pluginutils";import{createRollupLogger as se}from"@visulima/packem-share/utils";import{dirname as L,normalize as M,isAbsolute as te,relative as U,resolve as oe,parse as T,join as _,basename as V}from"@visulima/path";import{isRelative as ie}from"@visulima/path/utils";import re from"p-queue";import ne from"./concat-BnU-BO62.js";import{inferSourceMapOption as ae,inferModeOption as ce,inferHandlerOption as W,inferOption as G,ensurePCSSOption as R,ensurePCSSPlugins as le}from"./inferModeOption-9h3Eq6JH.js";import{m as q}from"./sourcemap-DGfgaUBb.js";var ue=Object.defineProperty,de=N((e,t)=>ue(e,"name",{value:t,configurable:!0}),"r");const J=de((e,t)=>{if(!t)return!1;if(typeof t=="function")return t(e);if(typeof t.test=="function")return t.test(e);throw new Error("Invalid condition type")},"matchFile");var pe=Object.defineProperty,fe=N((e,t)=>pe(e,"name",{value:t,configurable:!0}),"a");const me=4,ge=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):me;class he{static{N(this,"c")}static{fe(this,"LoaderManager")}test;loaders=new Map;options;workQueue;logger;constructor({extensions:t,loaders:c,logger:y,options:O}){this.test=S=>t.some(g=>S.toLowerCase().endsWith(g)),c.length>0&&this.add(...c),this.options=O,this.logger=y}add(...t){for(const c of t)this.loaders.has(c.name)||this.loaders.set(c.name,c)}isSupported(t){if(this.test(t))return!0;for(const[,c]of this.loaders)if(J(t,c.test))return!0;return!1}async process(t,c){this.workQueue||(this.workQueue=new re({concurrency:ge-1}));for await(const[y,O]of this.loaders){const S={...c,options:this.options[y]??{}};if(O.alwaysProcess||J(S.id,O.test)){this.logger.debug({message:`Processing ${y} loader for ${S.id}`,plugin:"css"});try{const g=await this.workQueue.add(O.process.bind(S,t));g&&(t=g,this.logger.debug({message:`Completed ${y} loader for ${S.id}`,outputSize:g.code?.length||0,plugin:"css"}))}catch(g){throw this.logger.error({file:S.id,loader:y,message:`Error in ${y} loader for ${S.id}: ${g instanceof Error?g.message:String(g)}`,plugin:"css"}),g}}}return t}}var xe=Object.defineProperty,z=N((e,t)=>xe(e,"name",{value:t,configurable:!0}),"b");const ye=z(async(e,t)=>e.sort((c,y)=>t.indexOf(c.name)-t.indexOf(y.name)),"sortByNameOrder"),Fe=z(async(e,t,c,y,O,S,g,Z,K)=>{const C={...K,...e.alias},B=ee(e.include,e.exclude),b=ae(e.sourceMap),i={...ce(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};let a,I,H=!1;if(e.loaders)for(const r of e.loaders)r.name==="postcss"&&(H=!0);else e.loaders=[];H&&(i.postcss={...e.postcss,config:G(e.postcss?.config,{}),import:W(e.postcss?.import,C),modules:G(e.postcss?.modules,void 0),to:e.postcss?.to,url:W(e.postcss?.url,C)});let E=[];const F=z((r,u)=>{const m=[];for(const o of Object.keys(r)){const d=new Set;let h=[o];do{const $=[];for(const f of h){if(d.has(f))continue;if(I.isSupported(f)){B(f)&&$.push(f);continue}d.add(f);const P=u(f);P&&$.push(...P.importedIds)}h=$}while(h.some($=>!I.isSupported($)));m.push(...h)}return m},"traverseImportedModules");return{augmentChunkHash(r){if(E.length===0)return;const u=F(r.modules,this.getModuleInfo),m=E.filter(o=>u.includes(o.id)).sort((o,d)=>u.lastIndexOf(o.id)-u.lastIndexOf(d.id)).map(o=>`${V(o.id)}:${o.css}`);if(m.length!==0)return m.join(":")},async buildStart(){a=se(this,"css"),H&&i.postcss&&(e.postcss?.parser&&(i.postcss.parser=await R(e.postcss.parser,"parser",c,a)),e.postcss?.syntax&&(i.postcss.syntax=await R(e.postcss.syntax,"syntax",c,a)),e.postcss?.stringifier&&(i.postcss.stringifier=await R(e.postcss.stringifier,"stringifier",c,a)),e.postcss?.plugins&&(i.postcss.plugins=await le(e.postcss.plugins,c,a))),I=new he({extensions:i.extensions,loaders:await ye(e.loaders||[],["sourcemap","stylus","less","sass","postcss"]),logger:a,options:{...e,...i,alias:C}}),a.info({extract:typeof i.extract=="string"?i.extract:"individual",loaders:e.loaders?.map(r=>r.name)||[],message:"CSS plugin initialized",minify:!!(Z&&e.minifier),namedExports:!!i.namedExports,plugin:"css",sourceMap:!!S}),typeof i.inject=="object"&&i.inject.treeshakeable&&(i.namedExports=!1,a.info({message:"Disabling named exports due to `inject.treeshakeable` option",plugin:"css"}))},async generateBundle(r,u){if(E.length===0||!(r.dir||r.file))return;const m=Object.values(u),o=r.dir??L(r.file),d=m.filter(n=>n.type==="chunk"),h=d.filter(n=>!n.facadeModuleId),$=r.preserveModules?d:d.filter(n=>n.isEntry||n.isDynamicEntry),f=[],P=z(async(n,l)=>{const s=typeof i.extract=="string"?M(i.extract).replace(/^\.[/\\]/,""):M(`${n}.css`);te(s)&&this.error(["Extraction path must be relative to the output directory,",`which is ${U(c,o)}`].join(`
|
|
2
|
+
`)),ie(s)&&this.error(["Extraction path must be nested inside output directory,",`which is ${U(c,o)}`].join(`
|
|
3
|
+
`));const w=E.filter(x=>l.includes(x.id)).sort((x,v)=>l.lastIndexOf(x.id)-l.lastIndexOf(v.id)),D=await ne(w);return{css:D.css,map:q(D.map.toString()).relative(L(oe(o,s))).toString(),name:s}},"getExtractedData"),A=z(n=>{if(r.file)return T(r.file).name;if(r.preserveModules){const{dir:l,name:s}=T(n.fileName);return l?_(l,s):s}return n.name},"getName"),k=[];if(typeof i.extract=="string"){a.debug({message:`Extracting to ${i.extract}`,prefix:"css"});const n=[];for(const s of h){const w=F(s.modules,this.getModuleInfo);k.push(...w),n.push(...w)}for(const s of $)n.push(...F(s.modules,this.getModuleInfo).filter(w=>!k.includes(w)));const l=A(d[0]);f.push([l,n])}else{a.debug({message:"Extracting to individual files",prefix:"css"});for(const n of h){const l=F(n.modules,this.getModuleInfo);if(l.length===0)continue;k.push(...l);const s=A(n);f.push([s,l])}for(const n of $){const l=F(n.modules,this.getModuleInfo).filter(w=>!k.includes(w));if(l.length===0)continue;const s=A(n);f.push([s,l])}}for await(const[n,l]of f){const s=await P(n,l);if(typeof e.onExtract=="function"&&!e.onExtract(s))continue;if(Z&&e.minifier){a.info({message:`Minifying ${s.name} with ${e.minifier.name}`,prefix:"css"});const{css:x,map:v}=await e.minifier.handler.bind({browserTargets:t,logger:a})(s,b,e[e.minifier.name]??{});s.css=x,s.map=v}const w={fileName:s.name,name:s.name,names:[s.name],originalFileName:s.name,originalFileNames:[s.name],source:s.css,type:"asset"},D=this.emitFile(w);if(a.info({chunkIds:l.length,hasSourceMap:!!(s.map&&b),message:`Emitted CSS file: ${s.name}`,plugin:"css",size:s.css.length}),s.map&&b){const x=this.getFileName(D);let v="assert";typeof r.assetFileNames=="string"?v=M(L(r.assetFileNames)):typeof r.assetFileNames=="function"&&(v=M(L(r.assetFileNames(w))));const j=q(s.map).modify(p=>(p.file=V(x),p)).modifySources(p=>{if(p==="<no source>"||v.length<=1)return p;p=`../${p}`;for(const Q of v)Q==="/"&&(p=`../${p}`);return p});if(b.inline)j.modify(p=>b.transform?.(p,M(_(o,x)))),u[x].source+=j.toCommentData(),a.debug({message:`Generated inline source map for ${x}`,plugin:"css"});else{const p=`${x}.map`;j.modify(X=>b.transform?.(X,M(_(o,p)))),this.emitFile({fileName:p,source:j.toString(),type:"asset"});const{base:Q}=T(p);u[x].source+=j.toCommentFile(Q),a.debug({message:`Generated external source map: ${p}`,plugin:"css"})}}}f.length>0&&a.info({filesEmitted:f.length,message:"CSS processing complete",plugin:"css",totalExtracted:E.length,totalSize:f.reduce((n,[,l])=>n+l.length,0)})},name:"rollup-plugin-css",async transform(r,u){if(!B(u)||!I.isSupported(u))return;if(r.replaceAll(/\s/g,"")===""){a.debug({message:`Skipping empty file: ${u}`,plugin:"css"});return}a.info({message:`Processing CSS file: ${u}`,plugin:"css",size:r.length}),typeof e.onImport=="function"&&e.onImport(r,u);const m={alias:C,assets:new Map,autoModules:i.autoModules,browserTargets:t,cwd:c,debug:g,deps:new Set,dts:i.dts,emit:i.emit,environment:O,extensions:i.extensions,extract:i.extract,id:u,inject:i.inject,inline:i.inline,logger:a,namedExports:i.namedExports,options:{},plugin:this,sourceDir:y,sourceMap:b,useSourcemap:S},o=await I.process({code:r},m);a.info({assets:m.assets.size,dependencies:m.deps.size,hasExtracted:!!o.extracted,message:`Processed ${u}`,outputSize:o.code.length,plugin:"css"});for(const d of m.deps)this.addWatchFile(d);for(const[d,h]of m.assets)this.emitFile({fileName:d,source:h,type:"asset"}),a.debug({message:`Emitted asset: ${d}`,plugin:"css",size:h.length});if(o.extracted){const{id:d}=o.extracted;E=E.filter(h=>h.id!==d),E.push(o.extracted),a.debug({cssSize:o.extracted.css.length,hasSourceMap:!!o.extracted.map,message:`Extracted CSS from ${d}`,plugin:"css"})}return{code:o.code,map:b&&o.map?o.map:{mappings:""},meta:{styles:o.meta},moduleSideEffects:o.extracted?!0:void 0}}}},"cssPlugin");export{Fe as default};
|
|
@@ -90,6 +90,7 @@ interface LoaderContext<T = Record<string, unknown>> {
|
|
|
90
90
|
readonly extract: InternalStyleOptions["extract"];
|
|
91
91
|
readonly id: string;
|
|
92
92
|
readonly inject: InternalStyleOptions["inject"];
|
|
93
|
+
readonly inline: InternalStyleOptions["inline"];
|
|
93
94
|
readonly logger: RollupLogger;
|
|
94
95
|
readonly namedExports: InternalStyleOptions["namedExports"];
|
|
95
96
|
readonly options: T;
|
|
@@ -130,6 +131,8 @@ interface ExtractedData {
|
|
|
130
131
|
interface InjectOptions {
|
|
131
132
|
attributes?: Record<string, string>;
|
|
132
133
|
container?: string;
|
|
134
|
+
method?: string;
|
|
135
|
+
package?: string;
|
|
133
136
|
prepend?: boolean;
|
|
134
137
|
singleTag?: boolean;
|
|
135
138
|
treeshakeable?: boolean;
|
|
@@ -139,6 +142,7 @@ interface InternalStyleOptions extends StyleOptions {
|
|
|
139
142
|
extensions: NonNullable<StyleOptions["extensions"]>;
|
|
140
143
|
extract: boolean | string;
|
|
141
144
|
inject: InjectOptions | boolean | ((varname: string, id: string, output: string[]) => string);
|
|
145
|
+
inline: boolean;
|
|
142
146
|
}
|
|
143
147
|
type LightningCSSOptions = Omit<TransformOptions<CustomAtRules>, "code" | "cssModules" | "filename" | "minify" | "targets"> & {
|
|
144
148
|
modules?: TransformOptions<CustomAtRules>["cssModules"] & {
|
|
@@ -172,7 +176,7 @@ interface StyleOptions {
|
|
|
172
176
|
lightningcss?: LightningCSSOptions;
|
|
173
177
|
loaders?: Loader[];
|
|
174
178
|
minifier?: Minifier;
|
|
175
|
-
mode?: "emit" | "extract" | "inject" | ["extract", string] | ["inject", InjectOptions | ((varname: string, id: string) => string)];
|
|
179
|
+
mode?: "emit" | "extract" | "inject" | "inline" | ["extract", string] | ["inject", InjectOptions | ((varname: string, id: string) => string)];
|
|
176
180
|
namedExports?: boolean | ((name: string) => string);
|
|
177
181
|
onExtract?: (data: ExtractedData) => boolean;
|
|
178
182
|
onImport?: (code: string, id: string) => void;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SourceMapGenerator, RawSourceMap, SourceMapConsumer } from 'source-map-js';
|
|
2
|
-
import { h as Extracted, b as PostCSSOptions, S as StyleOptions, a as InternalStyleOptions, i as LoaderContext } from '../packem_shared/types-
|
|
2
|
+
import { h as Extracted, b as PostCSSOptions, S as StyleOptions, a as InternalStyleOptions, i as LoaderContext } from '../packem_shared/types-CA9pSumu.js';
|
|
3
3
|
import { RollupLogger } from '@visulima/packem-share/utils';
|
|
4
4
|
import { Result } from 'postcss-load-config';
|
|
5
5
|
import { NapiResolveOptions } from 'oxc-resolver';
|
|
@@ -27,16 +27,18 @@ interface Mode {
|
|
|
27
27
|
emit: InternalStyleOptions["emit"];
|
|
28
28
|
extract: InternalStyleOptions["extract"];
|
|
29
29
|
inject: InternalStyleOptions["inject"];
|
|
30
|
+
inline: InternalStyleOptions["inline"];
|
|
30
31
|
}
|
|
31
32
|
type PCSSOption = "parser" | "plugin" | "stringifier" | "syntax";
|
|
32
33
|
declare const inferModeOption: (mode: StyleOptions["mode"]) => Mode;
|
|
33
|
-
declare const inferOption: <T, TDefine extends T | boolean | undefined>(option: T | boolean | undefined, defaultValue: TDefine) => T
|
|
34
|
+
declare const inferOption: <T, TDefine extends T | boolean | undefined>(option: T | boolean | undefined, defaultValue: TDefine) => OptionType<T, TDefine>;
|
|
34
35
|
declare const inferSourceMapOption: (sourceMap: StyleOptions["sourceMap"]) => LoaderContext["sourceMap"];
|
|
35
36
|
declare const inferHandlerOption: <T extends {
|
|
36
37
|
alias?: Record<string, string>;
|
|
37
38
|
}>(option: T | boolean | undefined, alias: T["alias"]) => T | false;
|
|
38
39
|
declare const ensurePCSSOption: <T>(option: T | string, type: PCSSOption, cwd: string, logger: RollupLogger) => Promise<T>;
|
|
39
40
|
declare const ensurePCSSPlugins: (plugins: PostCSSOptions["plugins"], cwd: string, logger: RollupLogger) => Promise<Result["plugins"]>;
|
|
41
|
+
type OptionType<T, TDefine extends T | boolean | undefined> = T | TDefine | false;
|
|
40
42
|
|
|
41
43
|
declare const resolve: (ids: string[], userOptions: ResolveOptions) => string;
|
|
42
44
|
interface ResolveOptions extends NapiResolveOptions {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as o}from"../packem_shared/arrayFmt-Dek5cB7m.js";import{default as t}from"../packem_shared/concat-BnU-BO62.js";import{default as p}from"../packem_shared/loadModule-D20jQQNu.js";import{ensurePCSSOption as n,ensurePCSSPlugins as s,inferHandlerOption as l,inferModeOption as m,inferOption as d,inferSourceMapOption as u}from"../packem_shared/inferModeOption-9h3Eq6JH.js";import{resolve as M}from"../packem_shared/resolve-anj9ucIq.js";import{default as S}from"../packem_shared/safeId-BN5akJYJ.js";import{g,m as P,s as C}from"../packem_shared/sourcemap-DGfgaUBb.js";import{getUrlOfPartial as h,hasModuleSpecifier as v,normalizeUrl as y}from"../packem_shared/hasModuleSpecifier-DIZeev_W.js";export{o as arrayFmt,t as concat,n as ensurePCSSOption,s as ensurePCSSPlugins,g as getMap,h as getUrlOfPartial,v as hasModuleSpecifier,l as inferHandlerOption,m as inferModeOption,d as inferOption,u as inferSourceMapOption,p as loadModule,P as mm,y as normalizeUrl,M as resolve,S as safeId,C as stripMap};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/rollup-plugin-css",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.11",
|
|
4
4
|
"description": "CSS processing plugin for packem",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visulima",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "git+https://github.com/visulima/packem.git",
|
|
27
|
-
"directory": "packages/
|
|
27
|
+
"directory": "packages/rollup-plugin-css"
|
|
28
28
|
},
|
|
29
29
|
"funding": [
|
|
30
30
|
{
|
|
@@ -45,48 +45,48 @@
|
|
|
45
45
|
"type": "module",
|
|
46
46
|
"exports": {
|
|
47
47
|
".": {
|
|
48
|
-
"types": "./dist/index.d.
|
|
49
|
-
"default": "./dist/index.
|
|
48
|
+
"types": "./dist/index.d.ts",
|
|
49
|
+
"default": "./dist/index.js"
|
|
50
50
|
},
|
|
51
51
|
"./loader/sourcemap": {
|
|
52
|
-
"types": "./dist/loaders/sourcemap.d.
|
|
53
|
-
"default": "./dist/loaders/sourcemap.
|
|
52
|
+
"types": "./dist/loaders/sourcemap.d.ts",
|
|
53
|
+
"default": "./dist/loaders/sourcemap.js"
|
|
54
54
|
},
|
|
55
55
|
"./loader/less": {
|
|
56
|
-
"types": "./dist/loaders/less/index.d.
|
|
57
|
-
"default": "./dist/loaders/less/index.
|
|
56
|
+
"types": "./dist/loaders/less/index.d.ts",
|
|
57
|
+
"default": "./dist/loaders/less/index.js"
|
|
58
58
|
},
|
|
59
59
|
"./loader/postcss": {
|
|
60
|
-
"types": "./dist/loaders/postcss/index.d.
|
|
61
|
-
"default": "./dist/loaders/postcss/index.
|
|
60
|
+
"types": "./dist/loaders/postcss/index.d.ts",
|
|
61
|
+
"default": "./dist/loaders/postcss/index.js"
|
|
62
62
|
},
|
|
63
63
|
"./loader/sass": {
|
|
64
|
-
"types": "./dist/loaders/sass/index.d.
|
|
65
|
-
"default": "./dist/loaders/sass/index.
|
|
64
|
+
"types": "./dist/loaders/sass/index.d.ts",
|
|
65
|
+
"default": "./dist/loaders/sass/index.js"
|
|
66
66
|
},
|
|
67
67
|
"./loader/stylus": {
|
|
68
|
-
"types": "./dist/loaders/stylus/index.d.
|
|
69
|
-
"default": "./dist/loaders/stylus/index.
|
|
68
|
+
"types": "./dist/loaders/stylus/index.d.ts",
|
|
69
|
+
"default": "./dist/loaders/stylus/index.js"
|
|
70
70
|
},
|
|
71
71
|
"./loader/lightningcss": {
|
|
72
|
-
"types": "./dist/loaders/lightningcss.d.
|
|
73
|
-
"default": "./dist/loaders/lightningcss.
|
|
72
|
+
"types": "./dist/loaders/lightningcss.d.ts",
|
|
73
|
+
"default": "./dist/loaders/lightningcss.js"
|
|
74
74
|
},
|
|
75
75
|
"./loader/tailwindcss": {
|
|
76
|
-
"types": "./dist/loaders/tailwindcss-oxide.d.
|
|
77
|
-
"default": "./dist/loaders/tailwindcss-oxide.
|
|
76
|
+
"types": "./dist/loaders/tailwindcss-oxide.d.ts",
|
|
77
|
+
"default": "./dist/loaders/tailwindcss-oxide.js"
|
|
78
78
|
},
|
|
79
79
|
"./minifier/cssnano": {
|
|
80
|
-
"types": "./dist/minifiers/cssnano.d.
|
|
81
|
-
"default": "./dist/minifiers/cssnano.
|
|
80
|
+
"types": "./dist/minifiers/cssnano.d.ts",
|
|
81
|
+
"default": "./dist/minifiers/cssnano.js"
|
|
82
82
|
},
|
|
83
83
|
"./minifier/lightningcss": {
|
|
84
|
-
"types": "./dist/minifiers/lightningcss.d.
|
|
85
|
-
"default": "./dist/minifiers/lightningcss.
|
|
84
|
+
"types": "./dist/minifiers/lightningcss.d.ts",
|
|
85
|
+
"default": "./dist/minifiers/lightningcss.js"
|
|
86
86
|
},
|
|
87
87
|
"./utils": {
|
|
88
|
-
"types": "./dist/utils/index.d.
|
|
89
|
-
"default": "./dist/utils/index.
|
|
88
|
+
"types": "./dist/utils/index.d.ts",
|
|
89
|
+
"default": "./dist/utils/index.js"
|
|
90
90
|
},
|
|
91
91
|
"./package.json": "./package.json"
|
|
92
92
|
},
|
|
@@ -96,14 +96,14 @@
|
|
|
96
96
|
"dist"
|
|
97
97
|
],
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@rollup/pluginutils": "
|
|
100
|
-
"@visulima/fs": "
|
|
101
|
-
"@visulima/package": "
|
|
102
|
-
"@visulima/packem-share": "1.0.0-alpha.
|
|
103
|
-
"@visulima/path": "
|
|
104
|
-
"mlly": "
|
|
105
|
-
"oxc-resolver": "
|
|
106
|
-
"p-queue": "^
|
|
99
|
+
"@rollup/pluginutils": "5.3.0",
|
|
100
|
+
"@visulima/fs": "4.0.4",
|
|
101
|
+
"@visulima/package": "4.1.4",
|
|
102
|
+
"@visulima/packem-share": "1.0.0-alpha.15",
|
|
103
|
+
"@visulima/path": "1.4.0",
|
|
104
|
+
"mlly": "1.8.0",
|
|
105
|
+
"oxc-resolver": "11.14.0",
|
|
106
|
+
"p-queue": "^9.0.1",
|
|
107
107
|
"source-map-js": "^1.2.1"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"@csstools/postcss-slow-plugins": ">=2.0.0",
|
|
113
113
|
"@tailwindcss/node": ">=4.1.12",
|
|
114
114
|
"@tailwindcss/oxide": ">=4.1.12",
|
|
115
|
-
"@visulima/css-style-inject": "1.0.0-alpha.
|
|
115
|
+
"@visulima/css-style-inject": "1.0.0-alpha.11",
|
|
116
116
|
"cssnano": ">=7.0.0",
|
|
117
117
|
"icss-utils": ">=5.1.0",
|
|
118
118
|
"less": ">=4.0.0",
|
|
@@ -130,13 +130,10 @@
|
|
|
130
130
|
"stylus": ">=0.60.0"
|
|
131
131
|
},
|
|
132
132
|
"peerDependenciesMeta": {
|
|
133
|
-
"@
|
|
133
|
+
"@ckeditor/typedoc-plugins": {
|
|
134
134
|
"optional": true
|
|
135
135
|
},
|
|
136
|
-
"@
|
|
137
|
-
"optional": true
|
|
138
|
-
},
|
|
139
|
-
"@csstools/postcss-slow-plugins": {
|
|
136
|
+
"@swc/core": {
|
|
140
137
|
"optional": true
|
|
141
138
|
},
|
|
142
139
|
"@tailwindcss/node": {
|
|
@@ -145,10 +142,10 @@
|
|
|
145
142
|
"@tailwindcss/oxide": {
|
|
146
143
|
"optional": true
|
|
147
144
|
},
|
|
148
|
-
"
|
|
145
|
+
"cssnano": {
|
|
149
146
|
"optional": true
|
|
150
147
|
},
|
|
151
|
-
"
|
|
148
|
+
"esbuild": {
|
|
152
149
|
"optional": true
|
|
153
150
|
},
|
|
154
151
|
"icss-utils": {
|
|
@@ -160,6 +157,9 @@
|
|
|
160
157
|
"lightningcss": {
|
|
161
158
|
"optional": true
|
|
162
159
|
},
|
|
160
|
+
"oxc-transform": {
|
|
161
|
+
"optional": true
|
|
162
|
+
},
|
|
163
163
|
"postcss": {
|
|
164
164
|
"optional": true
|
|
165
165
|
},
|
|
@@ -189,10 +189,25 @@
|
|
|
189
189
|
},
|
|
190
190
|
"stylus": {
|
|
191
191
|
"optional": true
|
|
192
|
+
},
|
|
193
|
+
"sucrase": {
|
|
194
|
+
"optional": true
|
|
195
|
+
},
|
|
196
|
+
"typedoc": {
|
|
197
|
+
"optional": true
|
|
198
|
+
},
|
|
199
|
+
"typedoc-plugin-markdown": {
|
|
200
|
+
"optional": true
|
|
201
|
+
},
|
|
202
|
+
"typedoc-plugin-rename-defaults": {
|
|
203
|
+
"optional": true
|
|
204
|
+
},
|
|
205
|
+
"typescript": {
|
|
206
|
+
"optional": true
|
|
192
207
|
}
|
|
193
208
|
},
|
|
194
209
|
"engines": {
|
|
195
|
-
"node": ">=20
|
|
210
|
+
"node": ">=20.19 <=25.*"
|
|
196
211
|
},
|
|
197
212
|
"publishConfig": {
|
|
198
213
|
"access": "public",
|
package/dist/index.d.mts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'rollup';
|
|
2
|
-
import { S as StyleOptions } from './packem_shared/types-BS4hXME3.mjs';
|
|
3
|
-
export { A as AutoModules, E as ExtractedData, I as InjectOptions, a as InternalStyleOptions, L as LightningCSSOptions, P as PostCSSConfigLoaderOptions, b as PostCSSOptions } from './packem_shared/types-BS4hXME3.mjs';
|
|
4
|
-
import { Environment } from '@visulima/packem-share/types';
|
|
5
|
-
import 'cssnano';
|
|
6
|
-
import 'lightningcss';
|
|
7
|
-
import 'postcss';
|
|
8
|
-
import 'postcss-load-config';
|
|
9
|
-
import 'less';
|
|
10
|
-
import 'sass';
|
|
11
|
-
import 'sass-embedded';
|
|
12
|
-
import 'stylus';
|
|
13
|
-
import '@visulima/packem-share/utils';
|
|
14
|
-
import 'source-map-js';
|
|
15
|
-
|
|
16
|
-
declare const cssModulesTypesPlugin: (options: StyleOptions, rootDirectory: string) => Plugin;
|
|
17
|
-
|
|
18
|
-
declare const cssPlugin: (options: StyleOptions, browserTargets: string[], cwd: string, sourceDirectory: string, environment: Environment, useSourcemap: boolean, debug: boolean, minify: boolean, alias: Record<string, string>) => Promise<Plugin>;
|
|
19
|
-
|
|
20
|
-
export { StyleOptions, cssModulesTypesPlugin, cssPlugin as rollupCssPlugin };
|
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{default as e}from"./packem_shared/cssModulesTypesPlugin-B9_bJo_B.mjs";import{default as u}from"./packem_shared/rollupCssPlugin-D-7azn92.mjs";export{e as cssModulesTypesPlugin,u as rollupCssPlugin};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { c as Loader, d as LESSLoaderOptions } from '../../packem_shared/types-BS4hXME3.mjs';
|
|
2
|
-
import 'cssnano';
|
|
3
|
-
import 'lightningcss';
|
|
4
|
-
import 'postcss';
|
|
5
|
-
import 'postcss-load-config';
|
|
6
|
-
import 'less';
|
|
7
|
-
import '@visulima/packem-share/types';
|
|
8
|
-
import 'sass';
|
|
9
|
-
import 'sass-embedded';
|
|
10
|
-
import 'stylus';
|
|
11
|
-
import '@visulima/packem-share/utils';
|
|
12
|
-
import 'rollup';
|
|
13
|
-
import 'source-map-js';
|
|
14
|
-
|
|
15
|
-
declare const loader: Loader<LESSLoaderOptions>;
|
|
16
|
-
|
|
17
|
-
export { LESSLoaderOptions, loader as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c=Object.defineProperty;var l=(s,e)=>c(s,"name",{value:e,configurable:!0});import{dirname as u,normalize as d}from"@visulima/path";import f from"less";import{readFileSync as h}from"@visulima/fs";import{resolveAlias as g}from"@visulima/path/utils";import{resolve as y}from"../../packem_shared/resolve-nqhcPNJ9.mjs";import{normalizeUrl as F,getUrlOfPartial as v}from"../../packem_shared/hasModuleSpecifier-DIZeev_W.mjs";var b=Object.defineProperty,m=l((s,e)=>b(s,"name",{value:e,configurable:!0}),"i");const M=[".less",".css"],x=m((s,e)=>new class extends s.FileManager{supports(){return!0}async loadFile(r,a,t){const i=F(g(r,e)),o=v(i),n={baseDirs:[],caller:"Less importer",extensions:M};Array.isArray(t.paths)&&n.baseDirs.push(...t.paths),n.baseDirs.push(a);const p=y([o,i],n);return{contents:h(p),filename:p}}},"getStylesFileManager"),A=m(s=>({install(e,r){r.addFileManager(x(e,s))}}),"importer"),U={name:"less",async process({code:s,map:e}){const r=[A(this.alias)];this.options.plugins&&r.push(...this.options.plugins);const a=f.render,t=await a(s,{...this.options,filename:this.id,plugins:r,sourceMap:{outputSourceFiles:!0,sourceMapBasepath:u(this.id)}}),i=t.imports;for(const o of i)this.deps.add(d(o));return{code:t.css,map:t.map??e}},test:/\.less$/i};export{U as default};
|