ModyQyW / vite-plugin-stylelint

🚨 Stylelint plugin for Vite.
MIT License
23 stars 1 forks source link

SyntaxError: Named export 'formatters' not found #25

Closed PineappleLee closed 1 year ago

PineappleLee commented 1 year ago

Describe the bug

file vite-plugin-stylelint@3.1.0_ngd3nnoldxv7gfhbrkt64hq3pu/node_modules/vite-plugin-stylelint/dist/index.mjs:2

var oe=Object.create;var vt=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var nt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var ce=(t,o)=>()=>(t&&(o=t(t=0)),o);var et=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);var pe=(t,o,e,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of ue(o))!le.call(t,a)&&a!==e&&vt(t,a,{get:()=>o[a],enumerable:!(c=ie(o,a))||c.enumerable});return t};var _t=(t,o,e)=>(e=t!=null?oe(ae(t)):{},pe(o||!t||!t.__esModule?vt(e,"default",{value:t,enumerable:!0}):e,t));var k=ce(()=>{});var ot=et((or,wt)=>{"use strict";k();var fe=nt("path"),V="\\/",Ht=[^${V}],W="\.",he="\+",ye="\?",pt="\/",Ae="(?=.)",Ot="[^/]",Rt=(?:${pt}|$),Lt=(?:^|${pt}),gt=${W}{1,2}${Rt},_e=(?!${W}),Re=(?!${Lt}${gt}),ge=(?!${W}{0,1}${Rt}),Ee=(?!${gt}),me=[^.${pt}],Se=${Ot}*?,Tt={DOT_LITERAL:W,PLUS_LITERAL:he,QMARK_LITERAL:ye,SLASH_LITERAL:pt,ONE_CHAR:Ae,QMARK:Ot,END_ANCHOR:Rt,DOTS_SLASH:gt,NO_DOT:_e,NO_DOTS:Re,NO_DOT_SLASH:ge,NO_DOTS_SLASH:Ee,QMARK_NO_DOT:me,STAR:Se,START_ANCHOR:Lt},de={...Tt,SLASH_LITERAL:[${V}],QMARK:Ht,STAR:${Ht}*?,DOTS_SLASH:${W}{1,2}(?:[${V}]|$),NO_DOT:(?!${W}),NO_DOTS:(?!(?:^|[${V}])${W}{1,2}(?:[${V}]|$)),NO_DOT_SLASH:(?!${W}{0,1}(?:[${V}]|$)),NO_DOTS_SLASH:(?!${W}{1,2}(?:[${V}]|$)),QMARK_NO_DOT:[^.${V}],START_ANCHOR:(?:^|[${V}]),ENDANCHOR:(?:[${V}]|$)},$e={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\x00-\x7F",blank:" \t",cntrl:"\x00-\x1F\x7F",digit:"0-9",graph:"\x21-\x7E",lower:"a-z",print:"\x20-\x7E ",punct:"\-!\"#$%&'()\*+,./:;<=>?@[\]^{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};wt.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$e,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:fe.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:))${t.STAR})},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?de:Tt}}});var ft=et(F=>{"use strict";k();var xe=nt("path"),be=process.platform==="win32",{REGEX_BACKSLASH:Ce,REGEX_REMOVE_BACKSLASH:ve,REGEX_SPECIAL_CHARS:He,REGEX_SPECIAL_CHARS_GLOBAL:Oe}=ot();F.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);F.hasRegexChars=t=>He.test(t);F.isRegexChar=t=>t.length===1&&F.hasRegexChars(t);F.escapeRegex=t=>t.replace(Oe,"\\$1");F.toPosixSlashes=t=>t.replace(Ce,"/");F.removeBackslashes=t=>t.replace(ve,o=>o==="\\"?"":o);F.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};F.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:be===!0||xe.sep==="\\";F.escapeLast=(t,o,e)=>{let c=t.lastIndexOf(o,e);return c===-1?t:t[c-1]==="\\"?F.escapeLast(t,o,c-1):${t.slice(0,c)}\${t.slice(c)}};F.removePrefix=(t,o={})=>{let e=t;return e.startsWith("./")&&(e=e.slice(2),o.prefix="./"),e};F.wrapOutput=(t,o={},e={})=>{let c=e.contains?"":"^",a=e.contains?"":"$",y=${c}(?:${t})${a};return o.negated===!0&&(y=(?:^(?!${y}).$)),y}});var Gt=et((lr,Ft)=>{"use strict";k();var kt=ft(),{CHAR_ASTERISK:Et,CHAR_AT:Le,CHAR_BACKWARD_SLASH:it,CHAR_COMMA:Te,CHAR_DOT:mt,CHAR_EXCLAMATION_MARK:St,CHAR_FORWARD_SLASH:Mt,CHAR_LEFT_CURLY_BRACE:dt,CHAR_LEFT_PARENTHESES:$t,CHAR_LEFT_SQUARE_BRACKET:we,CHAR_PLUS:ke,CHAR_QUESTION_MARK:It,CHAR_RIGHT_CURLY_BRACE:Ie,CHAR_RIGHT_PARENTHESES:Nt,CHAR_RIGHT_SQUARE_BRACKET:Ne}=ot(),Pt=t=>t===Mt||t===it,Dt=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Pe=(t,o)=>{let e=o||{},c=t.length-1,a=e.parts===!0||e.scanToEnd===!0,y=[],l=[],f=[],p=t,R=-1,A=0,E=0,v=!1,T=!1,d=!1,H=!1,z=!1,K=!1,U=!1,O=!1,q=!1,N=!1,Z=0,P,h,S={value:"",depth:0,isGlob:!1},I=()=>R>=c,n=()=>p.charCodeAt(R+1),b=()=>(P=h,p.charCodeAt(++R));for(;R<c;){h=b();let D;if(h===it){U=S.backslashes=!0,h=b(),h===dt&&(K=!0);continue}if(K===!0||h===dt){for(Z++;I()!==!0&&(h=b());){if(h===it){U=S.backslashes=!0,b();continue}if(h===dt){Z++;continue}if(K!==!0&&h===mt&&(h=b())===mt){if(v=S.isBrace=!0,d=S.isGlob=!0,N=!0,a===!0)continue;break}if(K!==!0&&h===Te){if(v=S.isBrace=!0,d=S.isGlob=!0,N=!0,a===!0)continue;break}if(h===Ie&&(Z--,Z===0)){K=!1,v=S.isBrace=!0,N=!0;break}}if(a===!0)continue;break}if(h===Mt){if(y.push(R),l.push(S),S={value:"",depth:0,isGlob:!1},N===!0)continue;if(P===mt&&R===A+1){A+=2;continue}E=R+1;continue}if(e.noext!==!0&&(h===ke||h===Le||h===Et||h===It||h===St)===!0&&n()===$t){if(d=S.isGlob=!0,H=S.isExtglob=!0,N=!0,h===St&&R===A&&(q=!0),a===!0){for(;I()!==!0&&(h=b());){if(h===it){U=S.backslashes=!0,h=b();continue}if(h===Nt){d=S.isGlob=!0,N=!0;break}}continue}break}if(h===Et){if(P===Et&&(z=S.isGlobstar=!0),d=S.isGlob=!0,N=!0,a===!0)continue;break}if(h===It){if(d=S.isGlob=!0,N=!0,a===!0)continue;break}if(h===we){for(;I()!==!0&&(D=b());){if(D===it){U=S.backslashes=!0,b();continue}if(D===Ne){T=S.isBracket=!0,d=S.isGlob=!0,N=!0;break}}if(a===!0)continue;break}if(e.nonegate!==!0&&h===St&&R===A){O=S.negated=!0,A++;continue}if(e.noparen!==!0&&h===$t){if(d=S.isGlob=!0,a===!0){for(;I()!==!0&&(h=b());){if(h===$t){U=S.backslashes=!0,h=b();continue}if(h===Nt){N=!0;break}}continue}break}if(d===!0){if(N=!0,a===!0)continue;break}}e.noext===!0&&(H=!1,d=!1);let $=p,Y="",r="";A>0&&(Y=p.slice(0,A),p=p.slice(A),E-=A),$&&d===!0&&E>0?($=p.slice(0,E),r=p.slice(E)):d===!0?($="",r=p):$=p,$&&$!==""&&$!=="/"&&$!==p&&Pt($.charCodeAt($.length-1))&&($=$.slice(0,-1)),e.unescape===!0&&(r&&(r=kt.removeBackslashes(r)),$&&U===!0&&($=kt.removeBackslashes($)));let s={prefix:Y,input:t,start:A,base:$,glob:r,isBrace:v,isBracket:T,isGlob:d,isExtglob:H,isGlobstar:z,negated:O,negatedExtglob:q};if(e.tokens===!0&&(s.maxDepth=0,Pt(h)||l.push(S),s.tokens=l),e.parts===!0||e.tokens===!0){let D;for(let m=0;m<y.length;m++){let X=D?D+1:A,Q=y[m],G=t.slice(X,Q);e.tokens&&(m===0&&A!==0?(l[m].isPrefix=!0,l[m].value=Y):l[m].value=G,Dt(l[m]),s.maxDepth+=l[m].depth),(m!==0||G!=="")&&f.push(G),D=Q}if(D&&D+1<t.length){let m=t.slice(D+1);f.push(m),e.tokens&&(l[l.length-1].value=m,Dt(l[l.length-1]),s.maxDepth+=l[l.length-1].depth)}s.slashes=y,s.parts=f}return s};Ft.exports=Pe});var Kt=et((pr,Ut)=>{"use strict";k();var ht=ot(),B=ft(),{MAX_LENGTH:yt,POSIX_REGEX_SOURCE:De,REGEX_NON_SPECIAL_CHARS:Me,REGEX_SPECIAL_CHARS_BACKREF:Fe,REPLACEMENTS:Bt}=ht,Ge=(t,o)=>{if(typeof o.expandRange=="function")return o.expandRange(...t,o);t.sort();let e=[${t.join("-")}];try{new RegExp(e)}catch{return t.map(a=>B.escapeRegex(a)).join("..")}return e},rt=(t,o)=>Missing ${t}: "${o}" - use "\\${o}" to match literal characters,xt=(t,o)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Bt[t]||t;let e={...o},c=typeof e.maxLength=="number"?Math.min(yt,e.maxLength):yt,a=t.length;if(a>c)throw new SyntaxError(Input length: ${a}, exceeds maximum allowed length: ${c});let y={type:"bos",value:"",output:e.prepend||""},l=[y],f=e.capture?"":"?:",p=B.isWindows(o),R=ht.globChars(p),A=ht.extglobChars(R),{DOT_LITERAL:E,PLUS_LITERAL:v,SLASH_LITERAL:T,ONE_CHAR:d,DOTS_SLASH:H,NO_DOT:z,NO_DOT_SLASH:K,NO_DOTS_SLASH:U,QMARK:O,QMARK_NO_DOT:q,STAR:N,START_ANCHOR:Z}=R,P=u=>(${f}(?:(?!${Z}${u.dot?H:E}).)?),h=e.dot?"":z,S=e.dot?O:q,I=e.bash===!0?P(e):N;e.capture&&(I=(${I})),typeof e.noext=="boolean"&&(e.noextglob=e.noext);let n={input:t,index:-1,start:0,dot:e.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:l};t=B.removePrefix(t,n),a=t.length;let b=[],$=[],Y=[],r=y,s,D=()=>n.index===a-1,m=n.peek=(u=1)=>t[n.index+u],X=n.advance=()=>t[++n.index]||"",Q=()=>t.slice(n.index+1),G=(u="",x=0)=>{n.consumed+=u,n.index+=x},ut=u=>{n.output+=u.output!=null?u.output:u.value,G(u.value)},se=()=>{let u=1;for(;m()==="!"&&(m(2)!=="("||m(3)==="?");)X(),n.start++,u++;return u%2===0?!1:(n.negated=!0,n.start++,!0)},at=u=>{n[u]++,Y.push(u)},tt=u=>{n[u]--,Y.pop()},g=u=>{if(r.type==="globstar"){let x=n.braces>0&&(u.type==="comma"||u.type==="brace"),i=u.extglob===!0||b.length&&(u.type==="pipe"||u.type==="paren");u.type!=="slash"&&u.type!=="paren"&&!x&&!i&&(n.output=n.output.slice(0,-r.output.length),r.type="star",r.value="*",r.output=I,n.output+=r.output)}if(b.length&&u.type!=="paren"&&(b[b.length-1].inner+=u.value),(u.value||u.output)&&ut(u),r&&r.type==="text"&&u.type==="text"){r.value+=u.value,r.output=(r.output||"")+u.value;return}u.prev=r,l.push(u),r=u},lt=(u,x)=>{let i={...A[x],conditions:1,inner:""};i.prev=r,i.parens=n.parens,i.output=n.output;let _=(e.capture?"(":"")+i.open;at("parens"),g({type:u,value:x,output:n.output?"":d}),g({type:"paren",extglob:!0,value:X(),output:_}),b.push(i)},ne=u=>{let x=u.close+(e.capture?")":""),i;if(u.type==="negate"){let _=I;if(u.inner&&u.inner.length>1&&u.inner.includes("/")&&(_=P(e)),(_!==I||D()||/^\)+$/.test(Q()))&&(x=u.close=)$))${}),u.inner.includes("*")&&(i=Q())&&/^\.[^\\/.]+$/.test(i)){let C=xt(i,{...o,fastpaths:!1}).output;x=u.close=)${C})${})}u.prev.type==="bos"&&(n.negatedExtglob=!0)}g({type:"paren",extglob:!0,value:s,output:x}),tt("parens")};if(e.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let u=!1,x=t.replace(Fe,(i,_,C,M,w,At)=>M==="\\"?(u=!0,i):M==="?"?_?_+M+(w?O.repeat(w.length):""):At===0?S+(w?O.repeat(w.length):""):O.repeat(C.length):M==="."?E.repeat(C.length):M==="*"?_?_+M+(w?I:""):I:_?i:\${i});return u===!0&&(e.unescape===!0?x=x.replace(/\\/g,""):x=x.replace(/\\+/g,i=>i.length%2===0?"\\\\":i?"\\":"")),x===t&&e.contains===!0?(n.output=t,n):(n.output=B.wrapOutput(x,n,o),n)}for(;!D();){if(s=X(),s==="\0")continue;if(s==="\\"){let i=m();if(i==="/"&&e.bash!==!0||i==="."||i===";")continue;if(!i){s+="\\",g({type:"text",value:s});continue}let _=/^\\+/.exec(Q()),C=0;if(_&&_[0].length>2&&(C=_[0].length,n.index+=C,C%2!==0&&(s+="\\")),e.unescape===!0?s=X():s+=X(),n.brackets===0){g({type:"text",value:s});continue}}if(n.brackets>0&&(s!=="]"||r.value==="["||r.value==="[^")){if(e.posix!==!1&&s===":"){let i=r.value.slice(1);if(i.includes("[")&&(r.posix=!0,i.includes(":"))){let _=r.value.lastIndexOf("["),C=r.value.slice(0,_),M=r.value.slice(_+2),w=De[M];if(w){r.value=C+w,n.backtrack=!0,X(),!y.output&&l.indexOf(r)===1&&(y.output=d);continue}}}(s==="["&&m()!==":"||s==="-"&&m()==="]")&&(s=\${s}),s==="]"&&(r.value==="["||r.value==="[^")&&(s=\${s}),e.posix===!0&&s==="!"&&r.value==="["&&(s="^"),r.value+=s,ut({value:s});continue}if(n.quotes===1&&s!=='"'){s=B.escapeRegex(s),r.value+=s,ut({value:s});continue}if(s==='"'){n.quotes=n.quotes===1?0:1,e.keepQuotes===!0&&g({type:"text",value:s});continue}if(s==="("){at("parens"),g({type:"paren",value:s});continue}if(s===")"){if(n.parens===0&&e.strictBrackets===!0)throw new SyntaxError(rt("opening","("));let i=b[b.length-1];if(i&&n.parens===i.parens+1){ne(b.pop());continue}g({type:"paren",value:s,output:n.parens?")":"\\)"}),tt("parens");continue}if(s==="["){if(e.nobracket===!0||!Q().includes("]")){if(e.nobracket!==!0&&e.strictBrackets===!0)throw new SyntaxError(rt("closing","]"));s=\${s}}else at("brackets");g({type:"bracket",value:s});continue}if(s==="]"){if(e.nobracket===!0||r&&r.type==="bracket"&&r.value.length===1){g({type:"text",value:s,output:\${s}});continue}if(n.brackets===0){if(e.strictBrackets===!0)throw new SyntaxError(rt("opening","["));g({type:"text",value:s,output:\${s}});continue}tt("brackets");let i=r.value.slice(1);if(r.posix!==!0&&i[0]==="^"&&!i.includes("/")&&(s=/${s}),r.value+=s,ut({value:s}),e.literalBrackets===!1||B.hasRegexChars(i))continue;let _=B.escapeRegex(r.value);if(n.output=n.output.slice(0,-r.value.length),e.literalBrackets===!0){n.output+=_,r.value=_;continue}r.value=(${f}${}|${r.value})`,n.output+=r.value;continue}if(s==="{"&&e.nobrace!==!0){at("braces");let i={type:"brace",value:s,output:"(",outputIndex:n.output.length,tokensIndex:n.tokens.length};$.push(i),g(i);continue}if(s==="}"){let i=$[$.length-1];if(e.nobrace===!0||!i){g({type:"text",value:s,output:s});continue}let =")";if(i.dots===!0){let C=l.slice(),M=[];for(let w=C.length-1;w>=0&&(l.pop(),C[w].type!=="brace");w--)C[w].type!=="dots"&&M.unshift(C[w].value);=Ge(M,e),n.backtrack=!0}if(i.comma!==!0&&i.dots!==!0){let C=n.output.slice(0,i.outputIndex),M=n.tokens.slice(i.tokensIndex);i.value=i.output="\{",s=="\}",n.output=C;for(let w of M)n.output+=w.output||w.value}g({type:"brace",value:s,output:}),tt("braces"),$.pop();continue}if(s==="|"){b.length>0&&b[b.length-1].conditions++,g({type:"text",value:s});continue}if(s===","){let i=s,=$[$.length-1];&&Y[Y.length-1]==="braces"&&(.comma=!0,i="|"),g({type:"comma",value:s,output:i});continue}if(s==="/"){if(r.type==="dot"&&n.index===n.start+1){n.start=n.index+1,n.consumed="",n.output="",l.pop(),r=y;continue}g({type:"slash",value:s,output:T});continue}if(s==="."){if(n.braces>0&&r.type==="dot"){r.value==="."&&(r.output=E);let i=$[$.length-1];r.type="dots",r.output+=s,r.value+=s,i.dots=!0;continue}if(n.braces+n.parens===0&&r.type!=="bos"&&r.type!=="slash"){g({type:"text",value:s,output:E});continue}g({type:"dot",value:s,output:E});continue}if(s==="?"){if(!(r&&r.value==="(")&&e.noextglob!==!0&&m()==="("&&m(2)!=="?"){lt("qmark",s);continue}if(r&&r.type==="paren"){let =m(),C=s;if(==="<"&&!B.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(r.value==="("&&!/[!=<:]/.test()||==="<"&&!/<([!=]|\w+>)/.test(Q()))&&(C=\\${s}),g({type:"text",value:s,output:C});continue}if(e.dot!==!0&&(r.type==="slash"||r.type==="bos")){g({type:"qmark",value:s,output:q});continue}g({type:"qmark",value:s,output:O});continue}if(s==="!"){if(e.noextglob!==!0&&m()==="("&&(m(2)!=="?"||!/[!=<:]/.test(m(3)))){lt("negate",s);continue}if(e.nonegate!==!0&&n.index===0){se();continue}}if(s==="+"){if(e.noextglob!==!0&&m()==="("&&m(2)!=="?"){lt("plus",s);continue}if(r&&r.value==="("||e.regex===!1){g({type:"plus",value:s,output:v});continue}if(r&&(r.type==="bracket"||r.type==="paren"||r.type==="brace")||n.parens>0){g({type:"plus",value:s});continue}g({type:"plus",value:v});continue}if(s==="@"){if(e.noextglob!==!0&&m()==="("&&m(2)!=="?"){g({type:"at",extglob:!0,value:s,output:""});continue}g({type:"text",value:s});continue}if(s!==""){(s==="$"||s==="^")&&(s=\\${s});let i=Me.exec(Q());i&&(s+=i[0],n.index+=i[0].length),g({type:"text",value:s});continue}if(r&&(r.type==="globstar"||r.star===!0)){r.type="star",r.star=!0,r.value+=s,r.output=I,n.backtrack=!0,n.globstar=!0,G(s);continue}let u=Q();if(e.noextglob!==!0&&/^([^?]/.test(u)){lt("star",s);continue}if(r.type==="star"){if(e.noglobstar===!0){G(s);continue}let i=r.prev,=i.prev,C=i.type==="slash"||i.type==="bos",M=&&(.type==="star"||.type==="globstar");if(e.bash===!0&&(!C||u[0]&&u[0]!=="/")){g({type:"star",value:s,output:""});continue}let w=n.braces>0&&(i.type==="comma"||i.type==="brace"),At=b.length&&(i.type==="pipe"||i.type==="paren");if(!C&&i.type!=="paren"&&!w&&!At){g({type:"star",value:s,output:""});continue}for(;u.slice(0,3)==="/";){let ct=t[n.index+4];if(ct&&ct!=="/")break;u=u.slice(3),G("/",3)}if(i.type==="bos"&&D()){r.type="globstar",r.value+=s,r.output=P(e),n.output=r.output,n.globstar=!0,G(s);continue}if(i.type==="slash"&&i.prev.type!=="bos"&&!M&&D()){n.output=n.output.slice(0,-(i.output+r.output).length),i.output=(?:${i.output},r.type="globstar",r.output=P(e)+(e.strictSlashes?")":"|$)"),r.value+=s,n.globstar=!0,n.output+=i.output+r.output,G(s);continue}if(i.type==="slash"&&i.prev.type!=="bos"&&u[0]==="/"){let ct=u[1]!==void 0?"|$":"";n.output=n.output.slice(0,-(i.output+r.output).length),i.output=(?:${i.output},r.type="globstar",r.output=${P(e)}${T}|${T}${ct}),r.value+=s,n.output+=i.output+r.output,n.globstar=!0,G(s+X()),g({type:"slash",value:"/",output:""});continue}if(i.type==="bos"&&u[0]==="/"){r.type="globstar",r.value+=s,r.output=(?:^|${T}|${P(e)}${T}),n.output=r.output,n.globstar=!0,G(s+X()),g({type:"slash",value:"/",output:""});continue}n.output=n.output.slice(0,-r.output.length),r.type="globstar",r.output=P(e),r.value+=s,n.output+=r.output,n.globstar=!0,G(s);continue}let x={type:"star",value:s,output:I};if(e.bash===!0){x.output=".?",(r.type==="bos"||r.type==="slash")&&(x.output=h+x.output),g(x);continue}if(r&&(r.type==="bracket"||r.type==="paren")&&e.regex===!0){x.output=s,g(x);continue}(n.index===n.start||r.type==="slash"||r.type==="dot")&&(r.type==="dot"?(n.output+=K,r.output+=K):e.dot===!0?(n.output+=U,r.output+=U):(n.output+=h,r.output+=h),m()!==""&&(n.output+=d,r.output+=d)),g(x)}for(;n.brackets>0;){if(e.strictBrackets===!0)throw new SyntaxError(rt("closing","]"));n.output=B.escapeLast(n.output,"["),tt("brackets")}for(;n.parens>0;){if(e.strictBrackets===!0)throw new SyntaxError(rt("closing",")"));n.output=B.escapeLast(n.output,"("),tt("parens")}for(;n.braces>0;){if(e.strictBrackets===!0)throw new SyntaxError(rt("closing","}"));n.output=B.escapeLast(n.output,"{"),tt("braces")}if(e.strictSlashes!==!0&&(r.type==="star"||r.type==="bracket")&&g({type:"maybe_slash",value:"",output:${T}?}),n.backtrack===!0){n.output="";for(let u of n.tokens)n.output+=u.output!=null?u.output:u.value,u.suffix&&(n.output+=u.suffix)}return n};xt.fastpaths=(t,o)=>{let e={...o},c=typeof e.maxLength=="number"?Math.min(yt,e.maxLength):yt,a=t.length;if(a>c)throw new SyntaxError(Input length: ${a}, exceeds maximum allowed length: ${c});t=Bt[t]||t;let y=B.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:R,NO_DOT:A,NO_DOTS:E,NO_DOTS_SLASH:v,STAR:T,START_ANCHOR:d}=ht.globChars(y),H=e.dot?E:A,z=e.dot?v:A,K=e.capture?"":"?:",U={negated:!1,prefix:""},O=e.bash===!0?".?":T;e.capture&&(O=(${O}));let q=h=>h.noglobstar===!0?O:(${K}(?:(?!${d}${h.dot?R:l}).)*?),N=h=>{switch(h){case"":return${H}${p}${O};case".":return${l}${p}${O};case".":return${H}${O}${l}${p}${O};case"/":return${H}${O}${f}${p}${z}${O};case"":return H+q(e);case"/*":return(?:${H}${q(e)}${f})?${z}${p}${O};case"/.":return(?:${H}${q(e)}${f})?${z}${O}${l}${p}${O};case"/.":return(?:${H}${q(e)}${f})?${l}${p}${O};default:{let S=/^(.?).(\w+)$/.exec(h);if(!S)return;let I=N(S[1]);return I?I+l+S[2]:void 0}}},Z=B.removePrefix(t,U),P=N(Z);return P&&e.strictSlashes!==!0&&(P+=${f}?),P};Ut.exports=xt});var Xt=et((hr,qt)=>{"use strict";k();var Be=nt("path"),Ue=Gt(),bt=Kt(),Ct=ft(),Ke=ot(),qe=t=>t&&typeof t=="object"&&!Array.isArray(t),L=(t,o,e=!1)=>{if(Array.isArray(t)){let A=t.map(v=>L(v,o,e));return v=>{for(let T of A){let d=T(v);if(d)return d}return!1}}let c=qe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");let a=o||{},y=Ct.isWindows(o),l=c?L.compileRe(t,o):L.makeRe(t,o,!1,!0),f=l.state;delete l.state;let p=()=>!1;if(a.ignore){let A={...o,ignore:null,onMatch:null,onResult:null};p=L(a.ignore,A,e)}let R=(A,E=!1)=>{let{isMatch:v,match:T,output:d}=L.test(A,l,o,{glob:t,posix:y}),H={glob:t,state:f,regex:l,posix:y,input:A,output:d,match:T,isMatch:v};return typeof a.onResult=="function"&&a.onResult(H),v===!1?(H.isMatch=!1,E?H:!1):p(A)?(typeof a.onIgnore=="function"&&a.onIgnore(H),H.isMatch=!1,E?H:!1):(typeof a.onMatch=="function"&&a.onMatch(H),E?H:!0)};return e&&(R.state=f),R};L.test=(t,o,e,{glob:c,posix:a}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let y=e||{},l=y.format||(a?Ct.toPosixSlashes:null),f=t===c,p=f&&l?l(t):t;return f===!1&&(p=l?l(t):t,f=p===c),(f===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?f=L.matchBase(t,o,e,a):f=o.exec(p)),{isMatch:Boolean(f),match:f,output:p}};L.matchBase=(t,o,e,c=Ct.isWindows(e))=>(o instanceof RegExp?o:L.makeRe(o,e)).test(Be.basename(t));L.isMatch=(t,o,e)=>L(o,e)(t);L.parse=(t,o)=>Array.isArray(t)?t.map(e=>L.parse(e,o)):bt(t,{...o,fastpaths:!1});L.scan=(t,o)=>Ue(t,o);L.compileRe=(t,o,e=!1,c=!1)=>{if(e===!0)return t.output;let a=o||{},y=a.contains?"":"^",l=a.contains?"":"$",f=${y}(?:${t.output})${l};t&&t.negated===!0&&(f=^(?!${f}).*$);let p=L.toRegex(f,o);return c===!0&&(p.state=t),p};L.makeRe=(t,o={},e=!1,c=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let a={negated:!1,fastpaths:!0};return o.fastpaths!==!1&&(t[0]==="."||t[0]==="")&&(a.output=bt.fastpaths(t,o)),a.output||(a=bt(t,o)),L.compileRe(a,o,e,c)};L.toRegex=(t,o)=>{try{let e=o||{};return new RegExp(t,e.flags||(e.nocase?"i":""))}catch(e){if(o&&o.debug===!0)throw e;return/$^/}};L.constants=Ke;qt.exports=L});var Vt=et((Ar,Qt)=>{"use strict";k();Qt.exports=Xt()});k();k();var Zt=_t(Vt(),1);import{extname as gr,win32 as Xe,posix as zt,isAbsolute as Qe,resolve as Ve}from"path";function We(t){return Array.isArray(t)}function Wt(t){return We(t)?t:t==null?[]:[t]}var st=function(o){return o.split(Xe.sep).join(zt.sep)};function ze(t,o){if(o===!1||Qe(t)||t.startsWith(""))return st(t);let e=st(Ve(o||"")).replace(/[-^$*+?.()|[]{}]/g,"\$&");return zt.join(e,st(t))}var Yt=function(o,e,c){let a=c&&c.resolve,y=p=>p instanceof RegExp?p:{test:R=>{let A=ze(p,a);return(0,Zt.default)(A,{dot:!0})(R)}},l=Wt(o).map(y),f=Wt(e).map(y);return function(R){if(typeof R!="string"||/\0/.test(R))return!1;let A=st(R);for(let E=0;E<f.length;++E)if(f[E].test(A))return!1;for(let E=0;E<l.length;++E)if(l[E].test(A))return!0;return!l.length}},Ze="break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public",Ye="arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl",Je=new Set(${Ze} ${Ye}.split(" "));Je.add("");k();import{resolve as je}from"path";import{formatters as tr}from"stylelint";var Jt=t=>t.startsWith("virtual:")||t.startsWith("\0")||!t.includes("/"),jt=({cache:t,cacheLocation:o,include:e,exclude:c,stylelintPath:a,formatter:y,lintOnStart:l,emitError:f,emitErrorAsWarning:p,emitWarning:R,emitWarningAsError:A},{cacheDir:E})=>({cache:t!=null?t:!0,cacheLocation:o!=null?o:je(E,"vite-plugin-stylelint"),include:e!=null?e:["src/*/.{css,scss,sass,less,styl,vue,svelte}"],exclude:c!=null?c:["node_modules","virtual:"],stylelintPath:a!=null?a:"stylelint",formatter:y!=null?y:"string",lintOnStart:l!=null?l:!1,emitError:f!=null?f:!0,emitErrorAsWarning:p!=null?p:!1,emitWarning:R!=null?R:!0,emitWarningAsError:A!=null?A:!1}),te=t=>Yt(t.include,t.exclude),er=t=>({...t,allowEmptyInput:!0,cache:t.cache,cacheLocation:t.cacheLocation,files:t.files}),ee=async(t,o)=>{var e;try{let a=(await Promise.resolve().then(()=>_t(nt(t.stylelintPath)))).default,y=typeof t.formatter=="string"?tr[t.formatter]:t.formatter;return{stylelint:a,formatter:y}}catch(c){console.log(""),o.error(${(e=c==null?void 0:c.message)!=null?e:"Failed to import Stylelint. Have you installed and configured correctly?"})}},re=(t,o,e)=>{let{emitError:c,emitErrorAsWarning:a,emitWarning:y,emitWarningAsError:l}=e;return async(f,p)=>await t.lint({...er(e),files:p}).then(async R=>{if(!R)return;R.results.filter(E=>!E.ignored).forEach(E=>{E.warnings.forEach(({severity:v})=>{let T=o([E],R);v==="error"&&c&&(a?f.warn(T):f.error(T)),v==="warning"&&y&&(l?f.error(T):f.warn(T))})})}).catch(R=>{var A;console.log(""),f.error(${(A=R==null?void 0:R.message)!=null?A:R})})};function rr(t={}){let o,e,c,a,y;return{name:"vite:stylelint",configResolved(l){o=jt(t,l),e=te(o)},async buildStart(){if(!c){let l=await ee(o,this);c=l.stylelint,a=l.formatter,y=re(c,a,o)}o.lintOnStart&&(console.log(""),this.warn("Stylelint is linting all files in the project because lintOnStart is true. This will significantly slow down Vite."),await y(this,o.include))},async transform(l,f){let p=st(f).split("?")[0];return!e(p)||Jt(f)||await y(this,p),null}}}export{rr as default};

SyntaxError: Named export 'formatters' not found. The requested module 'stylelint' is a CommonJS module, which may not support all module.exports as named exports.

Reproduction

Step 1: Create a vite project by use pnpm create vite my-vue-app --template vue-ts, cd my-vue-app , and pnpm install Step 2: pnpm install stylelint vite-plugin-stylelint@^3.1.0 -D Step 3: in the vite.config.js file, set as follows:

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import StylelintPlugin from 'vite-plugin-stylelint';

export default defineConfig({
  plugins: [vue(),StylelintPlugin({fix:true})]
})

Step 4: pnpm run dev

Note: when replace the vite-plugin-stylelint@^3.1.0 by vite-plugin-stylelint@~3.0.10, the SyntaxError( Named export 'formatters' not found) does not occur

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz   
    Memory: 7.50 GB / 15.84 GB
  Binaries:
    Node: 16.18.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD 
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (107.0.1418.56)
    Internet Explorer: 11.0.19041.1566

Used Package Manager

pnpm

Validations

PineappleLee commented 1 year ago

The porblem occurs in the vite-plugin-stylelint@3.1.0, but it not in the vite-plugin-stylelint@3.0.10

ianzone commented 1 year ago

same issue here

failed to load config from /home/ian/templates/react/vite.config.ts error when starting dev server: file:///home/ian/templates/react/node_modules/.pnpm/vite-plugin-stylelint@3.1.0_ngd3nnoldxv7gfhbrkt64hq3pu/node_modules/vite-plugin-stylelint/dist/index.mjs:2 var oe=Object.create;var vt=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var nt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var ce=(t,o)=>()=>(t&&(o=t(t=0)),o);var et=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);var pe=(t,o,e,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of ue(o))!le.call(t,a)&&a!==e&&vt(t,a,{get:()=>o[a],enumerable:!(c=ie(o,a))||c.enumerable});return t};var _t=(t,o,e)=>(e=t!=null?oe(ae(t)):{},pe(o||!t||!t.__esModule?vt(e,"default",{value:t,enumerable:!0}):e,t));var k=ce(()=>{});var ot=et((or,wt)=>{"use strict";k();var fe=nt("path"),V="\\/",Ht=[^${V}],W="\.",he="\+",ye="\?",pt="\/",Ae="(?=.)",Ot="[^/]",Rt=(?:${pt}|$),Lt=(?:^|${pt}),gt=${W}{1,2}${Rt},_e=(?!${W}),Re=(?!${Lt}${gt}),ge=(?!${W}{0,1}${Rt}),Ee=(?!${gt}),me=[^.${pt}],Se=${Ot}*?,Tt={DOT_LITERAL:W,PLUS_LITERAL:he,QMARK_LITERAL:ye,SLASH_LITERAL:pt,ONE_CHAR:Ae,QMARK:Ot,END_ANCHOR:Rt,DOTS_SLASH:gt,NO_DOT:_e,NO_DOTS:Re,NO_DOT_SLASH:ge,NO_DOTS_SLASH:Ee,QMARK_NO_DOT:me,STAR:Se,START_ANCHOR:Lt},de={...Tt,SLASH_LITERAL:[${V}],QMARK:Ht,STAR:${Ht}*?,DOTS_SLASH:${W}{1,2}(?:[${V}]|$),NO_DOT:(?!${W}),NO_DOTS:(?!(?:^|[${V}])${W}{1,2}(?:[${V}]|$)),NO_DOT_SLASH:(?!${W}{0,1}(?:[${V}]|$)),NO_DOTS_SLASH:(?!${W}{1,2}(?:[${V}]|$)),QMARK_NO_DOT:[^.${V}],START_ANCHOR:(?:^|[${V}]),ENDANCHOR:(?:[${V}]|$)},$e={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\x00-\x7F",blank:" \t",cntrl:"\x00-\x1F\x7F",digit:"0-9",graph:"\x21-\x7E",lower:"a-z",print:"\x20-\x7E ",punct:"\-!\"#$%&'()\*+,./:;<=>?@[\]^{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};wt.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$e,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:fe.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:))${t.STAR})},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?de:Tt}}});var ft=et(F=>{"use strict";k();var xe=nt("path"),be=process.platform==="win32",{REGEX_BACKSLASH:Ce,REGEX_REMOVE_BACKSLASH:ve,REGEX_SPECIAL_CHARS:He,REGEX_SPECIAL_CHARS_GLOBAL:Oe}=ot();F.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);F.hasRegexChars=t=>He.test(t);F.isRegexChar=t=>t.length===1&&F.hasRegexChars(t);F.escapeRegex=t=>t.replace(Oe,"\\$1");F.toPosixSlashes=t=>t.replace(Ce,"/");F.removeBackslashes=t=>t.replace(ve,o=>o==="\\"?"":o);F.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};F.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:be===!0||xe.sep==="\\";F.escapeLast=(t,o,e)=>{let c=t.lastIndexOf(o,e);return c===-1?t:t[c-1]==="\\"?F.escapeLast(t,o,c-1):${t.slice(0,c)}\${t.slice(c)}};F.removePrefix=(t,o={})=>{let e=t;return e.startsWith("./")&&(e=e.slice(2),o.prefix="./"),e};F.wrapOutput=(t,o={},e={})=>{let c=e.contains?"":"^",a=e.contains?"":"$",y=${c}(?:${t})${a};return o.negated===!0&&(y=(?:^(?!${y}).$)),y}});var Gt=et((lr,Ft)=>{"use strict";k();var kt=ft(),{CHAR_ASTERISK:Et,CHAR_AT:Le,CHAR_BACKWARD_SLASH:it,CHAR_COMMA:Te,CHAR_DOT:mt,CHAR_EXCLAMATION_MARK:St,CHAR_FORWARD_SLASH:Mt,CHAR_LEFT_CURLY_BRACE:dt,CHAR_LEFT_PARENTHESES:$t,CHAR_LEFT_SQUARE_BRACKET:we,CHAR_PLUS:ke,CHAR_QUESTION_MARK:It,CHAR_RIGHT_CURLY_BRACE:Ie,CHAR_RIGHT_PARENTHESES:Nt,CHAR_RIGHT_SQUARE_BRACKET:Ne}=ot(),Pt=t=>t===Mt||t===it,Dt=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Pe=(t,o)=>{let e=o||{},c=t.length-1,a=e.parts===!0||e.scanToEnd===!0,y=[],l=[],f=[],p=t,R=-1,A=0,E=0,v=!1,T=!1,d=!1,H=!1,z=!1,K=!1,U=!1,O=!1,q=!1,N=!1,Z=0,P,h,S={value:"",depth:0,isGlob:!1},I=()=>R>=c,n=()=>p.charCodeAt(R+1),b=()=>(P=h,p.charCodeAt(++R));for(;R<c;){h=b();let D;if(h===it){U=S.backslashes=!0,h=b(),h===dt&&(K=!0);continue}if(K===!0||h===dt){for(Z++;I()!==!0&&(h=b());){if(h===it){U=S.backslashes=!0,b();continue}if(h===dt){Z++;continue}if(K!==!0&&h===mt&&(h=b())===mt){if(v=S.isBrace=!0,d=S.isGlob=!0,N=!0,a===!0)continue;break}if(K!==!0&&h===Te){if(v=S.isBrace=!0,d=S.isGlob=!0,N=!0,a===!0)continue;break}if(h===Ie&&(Z--,Z===0)){K=!1,v=S.isBrace=!0,N=!0;break}}if(a===!0)continue;break}if(h===Mt){if(y.push(R),l.push(S),S={value:"",depth:0,isGlob:!1},N===!0)continue;if(P===mt&&R===A+1){A+=2;continue}E=R+1;continue}if(e.noext!==!0&&(h===ke||h===Le||h===Et||h===It||h===St)===!0&&n()===$t){if(d=S.isGlob=!0,H=S.isExtglob=!0,N=!0,h===St&&R===A&&(q=!0),a===!0){for(;I()!==!0&&(h=b());){if(h===it){U=S.backslashes=!0,h=b();continue}if(h===Nt){d=S.isGlob=!0,N=!0;break}}continue}break}if(h===Et){if(P===Et&&(z=S.isGlobstar=!0),d=S.isGlob=!0,N=!0,a===!0)continue;break}if(h===It){if(d=S.isGlob=!0,N=!0,a===!0)continue;break}if(h===we){for(;I()!==!0&&(D=b());){if(D===it){U=S.backslashes=!0,b();continue}if(D===Ne){T=S.isBracket=!0,d=S.isGlob=!0,N=!0;break}}if(a===!0)continue;break}if(e.nonegate!==!0&&h===St&&R===A){O=S.negated=!0,A++;continue}if(e.noparen!==!0&&h===$t){if(d=S.isGlob=!0,a===!0){for(;I()!==!0&&(h=b());){if(h===$t){U=S.backslashes=!0,h=b();continue}if(h===Nt){N=!0;break}}continue}break}if(d===!0){if(N=!0,a===!0)continue;break}}e.noext===!0&&(H=!1,d=!1);let $=p,Y="",r="";A>0&&(Y=p.slice(0,A),p=p.slice(A),E-=A),$&&d===!0&&E>0?($=p.slice(0,E),r=p.slice(E)):d===!0?($="",r=p):$=p,$&&$!==""&&$!=="/"&&$!==p&&Pt($.charCodeAt($.length-1))&&($=$.slice(0,-1)),e.unescape===!0&&(r&&(r=kt.removeBackslashes(r)),$&&U===!0&&($=kt.removeBackslashes($)));let s={prefix:Y,input:t,start:A,base:$,glob:r,isBrace:v,isBracket:T,isGlob:d,isExtglob:H,isGlobstar:z,negated:O,negatedExtglob:q};if(e.tokens===!0&&(s.maxDepth=0,Pt(h)||l.push(S),s.tokens=l),e.parts===!0||e.tokens===!0){let D;for(let m=0;m<y.length;m++){let X=D?D+1:A,Q=y[m],G=t.slice(X,Q);e.tokens&&(m===0&&A!==0?(l[m].isPrefix=!0,l[m].value=Y):l[m].value=G,Dt(l[m]),s.maxDepth+=l[m].depth),(m!==0||G!=="")&&f.push(G),D=Q}if(D&&D+1<t.length){let m=t.slice(D+1);f.push(m),e.tokens&&(l[l.length-1].value=m,Dt(l[l.length-1]),s.maxDepth+=l[l.length-1].depth)}s.slashes=y,s.parts=f}return s};Ft.exports=Pe});var Kt=et((pr,Ut)=>{"use strict";k();var ht=ot(),B=ft(),{MAX_LENGTH:yt,POSIX_REGEX_SOURCE:De,REGEX_NON_SPECIAL_CHARS:Me,REGEX_SPECIAL_CHARS_BACKREF:Fe,REPLACEMENTS:Bt}=ht,Ge=(t,o)=>{if(typeof o.expandRange=="function")return o.expandRange(...t,o);t.sort();let e=[${t.join("-")}];try{new RegExp(e)}catch{return t.map(a=>B.escapeRegex(a)).join("..")}return e},rt=(t,o)=>Missing ${t}: "${o}" - use "\\${o}" to match literal characters,xt=(t,o)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Bt[t]||t;let e={...o},c=typeof e.maxLength=="number"?Math.min(yt,e.maxLength):yt,a=t.length;if(a>c)throw new SyntaxError(Input length: ${a}, exceeds maximum allowed length: ${c});let y={type:"bos",value:"",output:e.prepend||""},l=[y],f=e.capture?"":"?:",p=B.isWindows(o),R=ht.globChars(p),A=ht.extglobChars(R),{DOT_LITERAL:E,PLUS_LITERAL:v,SLASH_LITERAL:T,ONE_CHAR:d,DOTS_SLASH:H,NO_DOT:z,NO_DOT_SLASH:K,NO_DOTS_SLASH:U,QMARK:O,QMARK_NO_DOT:q,STAR:N,START_ANCHOR:Z}=R,P=u=>(${f}(?:(?!${Z}${u.dot?H:E}).)?),h=e.dot?"":z,S=e.dot?O:q,I=e.bash===!0?P(e):N;e.capture&&(I=(${I})),typeof e.noext=="boolean"&&(e.noextglob=e.noext);let n={input:t,index:-1,start:0,dot:e.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:l};t=B.removePrefix(t,n),a=t.length;let b=[],$=[],Y=[],r=y,s,D=()=>n.index===a-1,m=n.peek=(u=1)=>t[n.index+u],X=n.advance=()=>t[++n.index]||"",Q=()=>t.slice(n.index+1),G=(u="",x=0)=>{n.consumed+=u,n.index+=x},ut=u=>{n.output+=u.output!=null?u.output:u.value,G(u.value)},se=()=>{let u=1;for(;m()==="!"&&(m(2)!=="("||m(3)==="?");)X(),n.start++,u++;return u%2===0?!1:(n.negated=!0,n.start++,!0)},at=u=>{n[u]++,Y.push(u)},tt=u=>{n[u]--,Y.pop()},g=u=>{if(r.type==="globstar"){let x=n.braces>0&&(u.type==="comma"||u.type==="brace"),i=u.extglob===!0||b.length&&(u.type==="pipe"||u.type==="paren");u.type!=="slash"&&u.type!=="paren"&&!x&&!i&&(n.output=n.output.slice(0,-r.output.length),r.type="star",r.value="*",r.output=I,n.output+=r.output)}if(b.length&&u.type!=="paren"&&(b[b.length-1].inner+=u.value),(u.value||u.output)&&ut(u),r&&r.type==="text"&&u.type==="text"){r.value+=u.value,r.output=(r.output||"")+u.value;return}u.prev=r,l.push(u),r=u},lt=(u,x)=>{let i={...A[x],conditions:1,inner:""};i.prev=r,i.parens=n.parens,i.output=n.output;let _=(e.capture?"(":"")+i.open;at("parens"),g({type:u,value:x,output:n.output?"":d}),g({type:"paren",extglob:!0,value:X(),output:_}),b.push(i)},ne=u=>{let x=u.close+(e.capture?")":""),i;if(u.type==="negate"){let _=I;if(u.inner&&u.inner.length>1&&u.inner.includes("/")&&(_=P(e)),(_!==I||D()||/^\)+$/.test(Q()))&&(x=u.close=)$))${}),u.inner.includes("*")&&(i=Q())&&/^\.[^\\/.]+$/.test(i)){let C=xt(i,{...o,fastpaths:!1}).output;x=u.close=)${C})${})}u.prev.type==="bos"&&(n.negatedExtglob=!0)}g({type:"paren",extglob:!0,value:s,output:x}),tt("parens")};if(e.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let u=!1,x=t.replace(Fe,(i,_,C,M,w,At)=>M==="\\"?(u=!0,i):M==="?"?_?_+M+(w?O.repeat(w.length):""):At===0?S+(w?O.repeat(w.length):""):O.repeat(C.length):M==="."?E.repeat(C.length):M==="*"?_?_+M+(w?I:""):I:_?i:\${i});return u===!0&&(e.unescape===!0?x=x.replace(/\\/g,""):x=x.replace(/\\+/g,i=>i.length%2===0?"\\\\":i?"\\":"")),x===t&&e.contains===!0?(n.output=t,n):(n.output=B.wrapOutput(x,n,o),n)}for(;!D();){if(s=X(),s==="\0")continue;if(s==="\\"){let i=m();if(i==="/"&&e.bash!==!0||i==="."||i===";")continue;if(!i){s+="\\",g({type:"text",value:s});continue}let _=/^\\+/.exec(Q()),C=0;if(_&&_[0].length>2&&(C=_[0].length,n.index+=C,C%2!==0&&(s+="\\")),e.unescape===!0?s=X():s+=X(),n.brackets===0){g({type:"text",value:s});continue}}if(n.brackets>0&&(s!=="]"||r.value==="["||r.value==="[^")){if(e.posix!==!1&&s===":"){let i=r.value.slice(1);if(i.includes("[")&&(r.posix=!0,i.includes(":"))){let _=r.value.lastIndexOf("["),C=r.value.slice(0,_),M=r.value.slice(_+2),w=De[M];if(w){r.value=C+w,n.backtrack=!0,X(),!y.output&&l.indexOf(r)===1&&(y.output=d);continue}}}(s==="["&&m()!==":"||s==="-"&&m()==="]")&&(s=\${s}),s==="]"&&(r.value==="["||r.value==="[^")&&(s=\${s}),e.posix===!0&&s==="!"&&r.value==="["&&(s="^"),r.value+=s,ut({value:s});continue}if(n.quotes===1&&s!=='"'){s=B.escapeRegex(s),r.value+=s,ut({value:s});continue}if(s==='"'){n.quotes=n.quotes===1?0:1,e.keepQuotes===!0&&g({type:"text",value:s});continue}if(s==="("){at("parens"),g({type:"paren",value:s});continue}if(s===")"){if(n.parens===0&&e.strictBrackets===!0)throw new SyntaxError(rt("opening","("));let i=b[b.length-1];if(i&&n.parens===i.parens+1){ne(b.pop());continue}g({type:"paren",value:s,output:n.parens?")":"\\)"}),tt("parens");continue}if(s==="["){if(e.nobracket===!0||!Q().includes("]")){if(e.nobracket!==!0&&e.strictBrackets===!0)throw new SyntaxError(rt("closing","]"));s=\${s}}else at("brackets");g({type:"bracket",value:s});continue}if(s==="]"){if(e.nobracket===!0||r&&r.type==="bracket"&&r.value.length===1){g({type:"text",value:s,output:\${s}});continue}if(n.brackets===0){if(e.strictBrackets===!0)throw new SyntaxError(rt("opening","["));g({type:"text",value:s,output:\${s}});continue}tt("brackets");let i=r.value.slice(1);if(r.posix!==!0&&i[0]==="^"&&!i.includes("/")&&(s=/${s}),r.value+=s,ut({value:s}),e.literalBrackets===!1||B.hasRegexChars(i))continue;let _=B.escapeRegex(r.value);if(n.output=n.output.slice(0,-r.value.length),e.literalBrackets===!0){n.output+=_,r.value=_;continue}r.value=(${f}${}|${r.value})`,n.output+=r.value;continue}if(s==="{"&&e.nobrace!==!0){at("braces");let i={type:"brace",value:s,output:"(",outputIndex:n.output.length,tokensIndex:n.tokens.length};$.push(i),g(i);continue}if(s==="}"){let i=$[$.length-1];if(e.nobrace===!0||!i){g({type:"text",value:s,output:s});continue}let =")";if(i.dots===!0){let C=l.slice(),M=[];for(let w=C.length-1;w>=0&&(l.pop(),C[w].type!=="brace");w--)C[w].type!=="dots"&&M.unshift(C[w].value);=Ge(M,e),n.backtrack=!0}if(i.comma!==!0&&i.dots!==!0){let C=n.output.slice(0,i.outputIndex),M=n.tokens.slice(i.tokensIndex);i.value=i.output="\{",s=="\}",n.output=C;for(let w of M)n.output+=w.output||w.value}g({type:"brace",value:s,output:}),tt("braces"),$.pop();continue}if(s==="|"){b.length>0&&b[b.length-1].conditions++,g({type:"text",value:s});continue}if(s===","){let i=s,=$[$.length-1];&&Y[Y.length-1]==="braces"&&(.comma=!0,i="|"),g({type:"comma",value:s,output:i});continue}if(s==="/"){if(r.type==="dot"&&n.index===n.start+1){n.start=n.index+1,n.consumed="",n.output="",l.pop(),r=y;continue}g({type:"slash",value:s,output:T});continue}if(s==="."){if(n.braces>0&&r.type==="dot"){r.value==="."&&(r.output=E);let i=$[$.length-1];r.type="dots",r.output+=s,r.value+=s,i.dots=!0;continue}if(n.braces+n.parens===0&&r.type!=="bos"&&r.type!=="slash"){g({type:"text",value:s,output:E});continue}g({type:"dot",value:s,output:E});continue}if(s==="?"){if(!(r&&r.value==="(")&&e.noextglob!==!0&&m()==="("&&m(2)!=="?"){lt("qmark",s);continue}if(r&&r.type==="paren"){let =m(),C=s;if(==="<"&&!B.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(r.value==="("&&!/[!=<:]/.test()||==="<"&&!/<([!=]|\w+>)/.test(Q()))&&(C=\\${s}),g({type:"text",value:s,output:C});continue}if(e.dot!==!0&&(r.type==="slash"||r.type==="bos")){g({type:"qmark",value:s,output:q});continue}g({type:"qmark",value:s,output:O});continue}if(s==="!"){if(e.noextglob!==!0&&m()==="("&&(m(2)!=="?"||!/[!=<:]/.test(m(3)))){lt("negate",s);continue}if(e.nonegate!==!0&&n.index===0){se();continue}}if(s==="+"){if(e.noextglob!==!0&&m()==="("&&m(2)!=="?"){lt("plus",s);continue}if(r&&r.value==="("||e.regex===!1){g({type:"plus",value:s,output:v});continue}if(r&&(r.type==="bracket"||r.type==="paren"||r.type==="brace")||n.parens>0){g({type:"plus",value:s});continue}g({type:"plus",value:v});continue}if(s==="@"){if(e.noextglob!==!0&&m()==="("&&m(2)!=="?"){g({type:"at",extglob:!0,value:s,output:""});continue}g({type:"text",value:s});continue}if(s!==""){(s==="$"||s==="^")&&(s=\\${s});let i=Me.exec(Q());i&&(s+=i[0],n.index+=i[0].length),g({type:"text",value:s});continue}if(r&&(r.type==="globstar"||r.star===!0)){r.type="star",r.star=!0,r.value+=s,r.output=I,n.backtrack=!0,n.globstar=!0,G(s);continue}let u=Q();if(e.noextglob!==!0&&/^([^?]/.test(u)){lt("star",s);continue}if(r.type==="star"){if(e.noglobstar===!0){G(s);continue}let i=r.prev,=i.prev,C=i.type==="slash"||i.type==="bos",M=&&(.type==="star"||.type==="globstar");if(e.bash===!0&&(!C||u[0]&&u[0]!=="/")){g({type:"star",value:s,output:""});continue}let w=n.braces>0&&(i.type==="comma"||i.type==="brace"),At=b.length&&(i.type==="pipe"||i.type==="paren");if(!C&&i.type!=="paren"&&!w&&!At){g({type:"star",value:s,output:""});continue}for(;u.slice(0,3)==="/";){let ct=t[n.index+4];if(ct&&ct!=="/")break;u=u.slice(3),G("/",3)}if(i.type==="bos"&&D()){r.type="globstar",r.value+=s,r.output=P(e),n.output=r.output,n.globstar=!0,G(s);continue}if(i.type==="slash"&&i.prev.type!=="bos"&&!M&&D()){n.output=n.output.slice(0,-(i.output+r.output).length),i.output=(?:${i.output},r.type="globstar",r.output=P(e)+(e.strictSlashes?")":"|$)"),r.value+=s,n.globstar=!0,n.output+=i.output+r.output,G(s);continue}if(i.type==="slash"&&i.prev.type!=="bos"&&u[0]==="/"){let ct=u[1]!==void 0?"|$":"";n.output=n.output.slice(0,-(i.output+r.output).length),i.output=(?:${i.output},r.type="globstar",r.output=${P(e)}${T}|${T}${ct}),r.value+=s,n.output+=i.output+r.output,n.globstar=!0,G(s+X()),g({type:"slash",value:"/",output:""});continue}if(i.type==="bos"&&u[0]==="/"){r.type="globstar",r.value+=s,r.output=(?:^|${T}|${P(e)}${T}),n.output=r.output,n.globstar=!0,G(s+X()),g({type:"slash",value:"/",output:""});continue}n.output=n.output.slice(0,-r.output.length),r.type="globstar",r.output=P(e),r.value+=s,n.output+=r.output,n.globstar=!0,G(s);continue}let x={type:"star",value:s,output:I};if(e.bash===!0){x.output=".?",(r.type==="bos"||r.type==="slash")&&(x.output=h+x.output),g(x);continue}if(r&&(r.type==="bracket"||r.type==="paren")&&e.regex===!0){x.output=s,g(x);continue}(n.index===n.start||r.type==="slash"||r.type==="dot")&&(r.type==="dot"?(n.output+=K,r.output+=K):e.dot===!0?(n.output+=U,r.output+=U):(n.output+=h,r.output+=h),m()!==""&&(n.output+=d,r.output+=d)),g(x)}for(;n.brackets>0;){if(e.strictBrackets===!0)throw new SyntaxError(rt("closing","]"));n.output=B.escapeLast(n.output,"["),tt("brackets")}for(;n.parens>0;){if(e.strictBrackets===!0)throw new SyntaxError(rt("closing",")"));n.output=B.escapeLast(n.output,"("),tt("parens")}for(;n.braces>0;){if(e.strictBrackets===!0)throw new SyntaxError(rt("closing","}"));n.output=B.escapeLast(n.output,"{"),tt("braces")}if(e.strictSlashes!==!0&&(r.type==="star"||r.type==="bracket")&&g({type:"maybe_slash",value:"",output:${T}?}),n.backtrack===!0){n.output="";for(let u of n.tokens)n.output+=u.output!=null?u.output:u.value,u.suffix&&(n.output+=u.suffix)}return n};xt.fastpaths=(t,o)=>{let e={...o},c=typeof e.maxLength=="number"?Math.min(yt,e.maxLength):yt,a=t.length;if(a>c)throw new SyntaxError(Input length: ${a}, exceeds maximum allowed length: ${c});t=Bt[t]||t;let y=B.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:R,NO_DOT:A,NO_DOTS:E,NO_DOTS_SLASH:v,STAR:T,START_ANCHOR:d}=ht.globChars(y),H=e.dot?E:A,z=e.dot?v:A,K=e.capture?"":"?:",U={negated:!1,prefix:""},O=e.bash===!0?".?":T;e.capture&&(O=(${O}));let q=h=>h.noglobstar===!0?O:(${K}(?:(?!${d}${h.dot?R:l}).)*?),N=h=>{switch(h){case"":return${H}${p}${O};case".":return${l}${p}${O};case".":return${H}${O}${l}${p}${O};case"/":return${H}${O}${f}${p}${z}${O};case"":return H+q(e);case"/*":return(?:${H}${q(e)}${f})?${z}${p}${O};case"/.":return(?:${H}${q(e)}${f})?${z}${O}${l}${p}${O};case"/.":return(?:${H}${q(e)}${f})?${l}${p}${O};default:{let S=/^(.?).(\w+)$/.exec(h);if(!S)return;let I=N(S[1]);return I?I+l+S[2]:void 0}}},Z=B.removePrefix(t,U),P=N(Z);return P&&e.strictSlashes!==!0&&(P+=${f}?),P};Ut.exports=xt});var Xt=et((hr,qt)=>{"use strict";k();var Be=nt("path"),Ue=Gt(),bt=Kt(),Ct=ft(),Ke=ot(),qe=t=>t&&typeof t=="object"&&!Array.isArray(t),L=(t,o,e=!1)=>{if(Array.isArray(t)){let A=t.map(v=>L(v,o,e));return v=>{for(let T of A){let d=T(v);if(d)return d}return!1}}let c=qe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");let a=o||{},y=Ct.isWindows(o),l=c?L.compileRe(t,o):L.makeRe(t,o,!1,!0),f=l.state;delete l.state;let p=()=>!1;if(a.ignore){let A={...o,ignore:null,onMatch:null,onResult:null};p=L(a.ignore,A,e)}let R=(A,E=!1)=>{let{isMatch:v,match:T,output:d}=L.test(A,l,o,{glob:t,posix:y}),H={glob:t,state:f,regex:l,posix:y,input:A,output:d,match:T,isMatch:v};return typeof a.onResult=="function"&&a.onResult(H),v===!1?(H.isMatch=!1,E?H:!1):p(A)?(typeof a.onIgnore=="function"&&a.onIgnore(H),H.isMatch=!1,E?H:!1):(typeof a.onMatch=="function"&&a.onMatch(H),E?H:!0)};return e&&(R.state=f),R};L.test=(t,o,e,{glob:c,posix:a}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let y=e||{},l=y.format||(a?Ct.toPosixSlashes:null),f=t===c,p=f&&l?l(t):t;return f===!1&&(p=l?l(t):t,f=p===c),(f===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?f=L.matchBase(t,o,e,a):f=o.exec(p)),{isMatch:Boolean(f),match:f,output:p}};L.matchBase=(t,o,e,c=Ct.isWindows(e))=>(o instanceof RegExp?o:L.makeRe(o,e)).test(Be.basename(t));L.isMatch=(t,o,e)=>L(o,e)(t);L.parse=(t,o)=>Array.isArray(t)?t.map(e=>L.parse(e,o)):bt(t,{...o,fastpaths:!1});L.scan=(t,o)=>Ue(t,o);L.compileRe=(t,o,e=!1,c=!1)=>{if(e===!0)return t.output;let a=o||{},y=a.contains?"":"^",l=a.contains?"":"$",f=${y}(?:${t.output})${l};t&&t.negated===!0&&(f=^(?!${f}).*$);let p=L.toRegex(f,o);return c===!0&&(p.state=t),p};L.makeRe=(t,o={},e=!1,c=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let a={negated:!1,fastpaths:!0};return o.fastpaths!==!1&&(t[0]==="."||t[0]==="")&&(a.output=bt.fastpaths(t,o)),a.output||(a=bt(t,o)),L.compileRe(a,o,e,c)};L.toRegex=(t,o)=>{try{let e=o||{};return new RegExp(t,e.flags||(e.nocase?"i":""))}catch(e){if(o&&o.debug===!0)throw e;return/$^/}};L.constants=Ke;qt.exports=L});var Vt=et((Ar,Qt)=>{"use strict";k();Qt.exports=Xt()});k();k();var Zt=_t(Vt(),1);import{extname as gr,win32 as Xe,posix as zt,isAbsolute as Qe,resolve as Ve}from"path";function We(t){return Array.isArray(t)}function Wt(t){return We(t)?t:t==null?[]:[t]}var st=function(o){return o.split(Xe.sep).join(zt.sep)};function ze(t,o){if(o===!1||Qe(t)||t.startsWith(""))return st(t);let e=st(Ve(o||"")).replace(/[-^$*+?.()|[]{}]/g,"\$&");return zt.join(e,st(t))}var Yt=function(o,e,c){let a=c&&c.resolve,y=p=>p instanceof RegExp?p:{test:R=>{let A=ze(p,a);return(0,Zt.default)(A,{dot:!0})(R)}},l=Wt(o).map(y),f=Wt(e).map(y);return function(R){if(typeof R!="string"||/\0/.test(R))return!1;let A=st(R);for(let E=0;E<f.length;++E)if(f[E].test(A))return!1;for(let E=0;E<l.length;++E)if(l[E].test(A))return!0;return!l.length}},Ze="break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public",Ye="arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl",Je=new Set(${Ze} ${Ye}.split(" "));Je.add("");k();import{resolve as je}from"path";import{formatters as tr}from"stylelint";var Jt=t=>t.startsWith("virtual:")||t.startsWith("\0")||!t.includes("/"),jt=({cache:t,cacheLocation:o,include:e,exclude:c,stylelintPath:a,formatter:y,lintOnStart:l,emitError:f,emitErrorAsWarning:p,emitWarning:R,emitWarningAsError:A},{cacheDir:E})=>({cache:t!=null?t:!0,cacheLocation:o!=null?o:je(E,"vite-plugin-stylelint"),include:e!=null?e:["src/*/.{css,scss,sass,less,styl,vue,svelte}"],exclude:c!=null?c:["node_modules","virtual:"],stylelintPath:a!=null?a:"stylelint",formatter:y!=null?y:"string",lintOnStart:l!=null?l:!1,emitError:f!=null?f:!0,emitErrorAsWarning:p!=null?p:!1,emitWarning:R!=null?R:!0,emitWarningAsError:A!=null?A:!1}),te=t=>Yt(t.include,t.exclude),er=t=>({...t,allowEmptyInput:!0,cache:t.cache,cacheLocation:t.cacheLocation,files:t.files}),ee=async(t,o)=>{var e;try{let a=(await Promise.resolve().then(()=>_t(nt(t.stylelintPath)))).default,y=typeof t.formatter=="string"?tr[t.formatter]:t.formatter;return{stylelint:a,formatter:y}}catch(c){console.log(""),o.error(${(e=c==null?void 0:c.message)!=null?e:"Failed to import Stylelint. Have you installed and configured correctly?"})}},re=(t,o,e)=>{let{emitError:c,emitErrorAsWarning:a,emitWarning:y,emitWarningAsError:l}=e;return async(f,p)=>await t.lint({...er(e),files:p}).then(async R=>{if(!R)return;R.results.filter(E=>!E.ignored).forEach(E=>{E.warnings.forEach(({severity:v})=>{let T=o([E],R);v==="error"&&c&&(a?f.warn(T):f.error(T)),v==="warning"&&y&&(l?f.error(T):f.warn(T))})})}).catch(R=>{var A;console.log(""),f.error(${(A=R==null?void 0:R.message)!=null?A:R})})};function rr(t={}){let o,e,c,a,y;return{name:"vite:stylelint",configResolved(l){o=jt(t,l),e=te(o)},async buildStart(){if(!c){let l=await ee(o,this);c=l.stylelint,a=l.formatter,y=re(c,a,o)}o.lintOnStart&&(console.log(""),this.warn("Stylelint is linting all files in the project because lintOnStart is true. This will significantly slow down Vite."),await y(this,o.include))},async transform(l,f){let p=st(f).split("?")[0];return!e(p)||Jt(f)||await y(this,p),null}}}export{rr as default};

SyntaxError: Named export 'formatters' not found. The requested module 'stylelint' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from 'stylelint'; const {get:(o,e)=>(typeof require<"u"?require:o)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var ce=(t,o)=>()=>(t&&(o=t(t=0)),o);var et=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);var pe=(t,o,e,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of ue(o))!le.call(t,a)&&a!==e&&vt(t,a,{get:()=>o[a],enumerable:!(c=ie(o,a))||c.enumerable});return t};var _t=(t,o,e)=>(e=t!=null?oe(ae(t)):{},pe(o||!t||!t.__esModule?vt(e,"default",{value:t,enumerable:!0}):e,t));var k=ce(()=>{});var ot=et((or,wt)=>{"use strict";k();var fe=nt("path"),V="\\/",Ht=[^${V}],W="\.",he="\+",ye="\?",pt="\/",Ae="(?=.)",Ot="[^/]",Rt=(?:${pt}|$),Lt=(?:^|${pt}),gt=${W}{1,2}${Rt},_e=(?!${W}),Re=(?!${Lt}${gt}),ge=(?!${W}{0,1}${Rt}),Ee=(?!${gt}),me=[^.${pt}],Se=${Ot}*?,Tt={DOT_LITERAL:W,PLUS_LITERAL:he,QMARK_LITERAL:ye,SLASH_LITERAL:pt,ONE_CHAR:Ae,QMARK:Ot,END_ANCHOR:Rt,DOTS_SLASH:gt,NO_DOT:_e,NO_DOTS:Re,NO_DOT_SLASH:ge,NO_DOTS_SLASH:Ee,QMARK_NO_DOT:me,STAR:Se,START_ANCHOR:Lt},de={...Tt,SLASH_LITERAL:[${V}],QMARK:Ht,STAR:${Ht}*?,DOTS_SLASH:${W}{1,2}(?:[${V}]|$),NO_DOT:(?!${W}),NO_DOTS:(?!(?:^|[${V}])${W}{1,2}(?:[${V}]|$)),NO_DOT_SLASH:(?!${W}{0,1}(?:[${V}]|$)),NO_DOTS_SLASH:(?!${W}{1,2}(?:[${V}]|$)),QMARK_NO_DOT:[^.${V}],START_ANCHOR:(?:^|[${V}]),ENDANCHOR:(?:[${V}]|$)},$e={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\x00-\x7F",blank:" \t",cntrl:"\x00-\x1F\x7F",digit:"0-9",graph:"\x21-\x7E",lower:"a-z",print:"\x20-\x7E ",punct:"\-!\"#$%&'()\*+,./:;<=>?@[\]^{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};wt.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$e,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:fe.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:))${t.STAR})},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?de:Tt}}});var ft=et(F=>{"use strict";k();var xe=nt("path"),be=process.platform==="win32",{REGEX_BACKSLASH:Ce,REGEX_REMOVE_BACKSLASH:ve,REGEX_SPECIAL_CHARS:He,REGEX_SPECIAL_CHARS_GLOBAL:Oe}=ot();F.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);F.hasRegexChars=t=>He.test(t);F.isRegexChar=t=>t.length===1&&F.hasRegexChars(t);F.escapeRegex=t=>t.replace(Oe,"\\$1");F.toPosixSlashes=t=>t.replace(Ce,"/");F.removeBackslashes=t=>t.replace(ve,o=>o==="\\"?"":o);F.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};F.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:be===!0||xe.sep==="\\";F.escapeLast=(t,o,e)=>{let c=t.lastIndexOf(o,e);return c===-1?t:t[c-1]==="\\"?F.escapeLast(t,o,c-1):${t.slice(0,c)}\${t.slice(c)}};F.removePrefix=(t,o={})=>{let e=t;return e.startsWith("./")&&(e=e.slice(2),o.prefix="./"),e};F.wrapOutput=(t,o={},e={})=>{let c=e.contains?"":"^",a=e.contains?"":"$",y=${c}(?:${t})${a};return o.negated===!0&&(y=(?:^(?!${y}).$)),y}});var Gt=et((lr,Ft)=>{"use strict";k();var kt=ft(),{CHAR_ASTERISK:Et,CHAR_AT:Le,CHAR_BACKWARD_SLASH:it,CHAR_COMMA:Te,CHAR_DOT:mt,CHAR_EXCLAMATION_MARK:St,CHAR_FORWARD_SLASH:Mt,CHAR_LEFT_CURLY_BRACE:dt,CHAR_LEFT_PARENTHESES:$t,CHAR_LEFT_SQUARE_BRACKET:we,CHAR_PLUS:ke,CHAR_QUESTION_MARK:It,CHAR_RIGHT_CURLY_BRACE:Ie,CHAR_RIGHT_PARENTHESES:Nt,CHAR_RIGHT_SQUARE_BRACKET:Ne}=ot(),Pt=t=>t===Mt||t===it,Dt=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Pe=(t,o)=>{let e=o||{},c=t.length-1,a=e.parts===!0||e.scanToEnd===!0,y=[],l=[],f=[],p=t,R=-1,A=0,E=0,v=!1,T=!1,d=!1,H=!1,z=!1,K=!1,U=!1,O=!1,q=!1,N=!1,Z=0,P,h,S={value:"",depth:0,isGlob:!1},I=()=>R>=c,n=()=>p.charCodeAt(R+1),b=()=>(P=h,p.charCodeAt(++R));for(;R<c;){h=b();let D;if(h===it){U=S.backslashes=!0,h=b(),h===dt&&(K=!0);continue}if(K===!0||h===dt){for(Z++;I()!==!0&&(h=b());){if(h===it){U=S.backslashes=!0,b();continue}if(h===dt){Z++;continue}if(K!==!0&&h===mt&&(h=b())===mt){if(v=S.isBrace=!0,d=S.isGlob=!0,N=!0,a===!0)continue;break}if(K!==!0&&h===Te){if(v=S.isBrace=!0,d=S.isGlob=!0,N=!0,a===!0)continue;break}if(h===Ie&&(Z--,Z===0)){K=!1,v=S.isBrace=!0,N=!0;break}}if(a===!0)continue;break}if(h===Mt){if(y.push(R),l.push(S),S={value:"",depth:0,isGlob:!1},N===!0)continue;if(P===mt&&R===A+1){A+=2;continue}E=R+1;continue}if(e.noext!==!0&&(h===ke||h===Le||h===Et||h===It||h===St)===!0&&n()===$t){if(d=S.isGlob=!0,H=S.isExtglob=!0,N=!0,h===St&&R===A&&(q=!0),a===!0){for(;I()!==!0&&(h=b());){if(h===it){U=S.backslashes=!0,h=b();continue}if(h===Nt){d=S.isGlob=!0,N=!0;break}}continue}break}if(h===Et){if(P===Et&&(z=S.isGlobstar=!0),d=S.isGlob=!0,N=!0,a===!0)continue;break}if(h===It){if(d=S.isGlob=!0,N=!0,a===!0)continue;break}if(h===we){for(;I()!==!0&&(D=b());){if(D===it){U=S.backslashes=!0,b();continue}if(D===Ne){T=S.isBracket=!0,d=S.isGlob=!0,N=!0;break}}if(a===!0)continue;break}if(e.nonegate!==!0&&h===St&&R===A){O=S.negated=!0,A++;continue}if(e.noparen!==!0&&h===$t){if(d=S.isGlob=!0,a===!0){for(;I()!==!0&&(h=b());){if(h===$t){U=S.backslashes=!0,h=b();continue}if(h===Nt){N=!0;break}}continue}break}if(d===!0){if(N=!0,a===!0)continue;break}}e.noext===!0&&(H=!1,d=!1);let $=p,Y="",r="";A>0&&(Y=p.slice(0,A),p=p.slice(A),E-=A),$&&d===!0&&E>0?($=p.slice(0,E),r=p.slice(E)):d===!0?($="",r=p):$=p,$&&$!==""&&$!=="/"&&$!==p&&Pt($.charCodeAt($.length-1))&&($=$.slice(0,-1)),e.unescape===!0&&(r&&(r=kt.removeBackslashes(r)),$&&U===!0&&($=kt.removeBackslashes($)));let s={prefix:Y,input:t,start:A,base:$,glob:r,isBrace:v,isBracket:T,isGlob:d,isExtglob:H,isGlobstar:z,negated:O,negatedExtglob:q};if(e.tokens===!0&&(s.maxDepth=0,Pt(h)||l.push(S),s.tokens=l),e.parts===!0||e.tokens===!0){let D;for(let m=0;m<y.length;m++){let X=D?D+1:A,Q=y[m],G=t.slice(X,Q);e.tokens&&(m===0&&A!==0?(l[m].isPrefix=!0,l[m].value=Y):l[m].value=G,Dt(l[m]),s.maxDepth+=l[m].depth),(m!==0||G!=="")&&f.push(G),D=Q}if(D&&D+1<t.length){let m=t.slice(D+1);f.push(m),e.tokens&&(l[l.length-1].value=m,Dt(l[l.length-1]),s.maxDepth+=l[l.length-1].depth)}s.slashes=y,s.parts=f}return s};Ft.exports=Pe});var Kt=et((pr,Ut)=>{"use strict";k();var ht=ot(),B=ft(),{MAX_LENGTH:yt,POSIX_REGEX_SOURCE:De,REGEX_NON_SPECIAL_CHARS:Me,REGEX_SPECIAL_CHARS_BACKREF:Fe,REPLACEMENTS:Bt}=ht,Ge=(t,o)=>{if(typeof o.expandRange=="function")return o.expandRange(...t,o);t.sort();let e=[${t.join("-")}];try{new RegExp(e)}catch{return t.map(a=>B.escapeRegex(a)).join("..")}return e},rt=(t,o)=>Missing ${t}: "${o}" - use "\\${o}" to match literal characters,xt=(t,o)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Bt[t]||t;let e={...o},c=typeof e.maxLength=="number"?Math.min(yt,e.maxLength):yt,a=t.length;if(a>c)throw new SyntaxError(Input length: ${a}, exceeds maximum allowed length: ${c});let y={type:"bos",value:"",output:e.prepend||""},l=[y],f=e.capture?"":"?:",p=B.isWindows(o),R=ht.globChars(p),A=ht.extglobChars(R),{DOT_LITERAL:E,PLUS_LITERAL:v,SLASH_LITERAL:T,ONE_CHAR:d,DOTS_SLASH:H,NO_DOT:z,NO_DOT_SLASH:K,NO_DOTS_SLASH:U,QMARK:O,QMARK_NO_DOT:q,STAR:N,START_ANCHOR:Z}=R,P=u=>(${f}(?:(?!${Z}${u.dot?H:E}).)?),h=e.dot?"":z,S=e.dot?O:q,I=e.bash===!0?P(e):N;e.capture&&(I=(${I})),typeof e.noext=="boolean"&&(e.noextglob=e.noext);let n={input:t,index:-1,start:0,dot:e.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:l};t=B.removePrefix(t,n),a=t.length;let b=[],$=[],Y=[],r=y,s,D=()=>n.index===a-1,m=n.peek=(u=1)=>t[n.index+u],X=n.advance=()=>t[++n.index]||"",Q=()=>t.slice(n.index+1),G=(u="",x=0)=>{n.consumed+=u,n.index+=x},ut=u=>{n.output+=u.output!=null?u.output:u.value,G(u.value)},se=()=>{let u=1;for(;m()==="!"&&(m(2)!=="("||m(3)==="?");)X(),n.start++,u++;return u%2===0?!1:(n.negated=!0,n.start++,!0)},at=u=>{n[u]++,Y.push(u)},tt=u=>{n[u]--,Y.pop()},g=u=>{if(r.type==="globstar"){let x=n.braces>0&&(u.type==="comma"||u.type==="brace"),i=u.extglob===!0||b.length&&(u.type==="pipe"||u.type==="paren");u.type!=="slash"&&u.type!=="paren"&&!x&&!i&&(n.output=n.output.slice(0,-r.output.length),r.type="star",r.value="*",r.output=I,n.output+=r.output)}if(b.length&&u.type!=="paren"&&(b[b.length-1].inner+=u.value),(u.value||u.output)&&ut(u),r&&r.type==="text"&&u.type==="text"){r.value+=u.value,r.output=(r.output||"")+u.value;return}u.prev=r,l.push(u),r=u},lt=(u,x)=>{let i={...A[x],conditions:1,inner:""};i.prev=r,i.parens=n.parens,i.output=n.output;let _=(e.capture?"(":"")+i.open;at("parens"),g({type:u,value:x,output:n.output?"":d}),g({type:"paren",extglob:!0,value:X(),output:_}),b.push(i)},ne=u=>{let x=u.close+(e.capture?")":""),i;if(u.type==="negate"){let _=I;if(u.inner&&u.inner.length>1&&u.inner.includes("/")&&(_=P(e)),(_!==I||D()||/^\)+$/.test(Q()))&&(x=u.close=)$))${}),u.inner.includes("*")&&(i=Q())&&/^\.[^\\/.]+$/.test(i)){let C=xt(i,{...o,fastpaths:!1}).output;x=u.close=)${C})${})}u.prev.type==="bos"&&(n.negatedExtglob=!0)}g({type:"paren",extglob:!0,value:s,output:x}),tt("parens")};if(e.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let u=!1,x=t.replace(Fe,(i,_,C,M,w,At)=>M==="\\"?(u=!0,i):M==="?"?_?_+M+(w?O.repeat(w.length):""):At===0?S+(w?O.repeat(w.length):""):O.repeat(C.length):M==="."?E.repeat(C.length):M==="*"?_?_+M+(w?I:""):I:_?i:\${i});return u===!0&&(e.unescape===!0?x=x.replace(/\\/g,""):x=x.replace(/\\+/g,i=>i.length%2===0?"\\\\":i?"\\":"")),x===t&&e.contains===!0?(n.output=t,n):(n.output=B.wrapOutput(x,n,o),n)}for(;!D();){if(s=X(),s==="\0")continue;if(s==="\\"){let i=m();if(i==="/"&&e.bash!==!0||i==="."||i===";")continue;if(!i){s+="\\",g({type:"text",value:s});continue}let _=/^\\+/.exec(Q()),C=0;if(_&&_[0].length>2&&(C=_[0].length,n.index+=C,C%2!==0&&(s+="\\")),e.unescape===!0?s=X():s+=X(),n.brackets===0){g({type:"text",value:s});continue}}if(n.brackets>0&&(s!=="]"||r.value==="["||r.value==="[^")){if(e.posix!==!1&&s===":"){let i=r.value.slice(1);if(i.includes("[")&&(r.posix=!0,i.includes(":"))){let _=r.value.lastIndexOf("["),C=r.value.slice(0,_),M=r.value.slice(_+2),w=De[M];if(w){r.value=C+w,n.backtrack=!0,X(),!y.output&&l.indexOf(r)===1&&(y.output=d);continue}}}(s==="["&&m()!==":"||s==="-"&&m()==="]")&&(s=\${s}),s==="]"&&(r.value==="["||r.value==="[^")&&(s=\${s}),e.posix===!0&&s==="!"&&r.value==="["&&(s="^"),r.value+=s,ut({value:s});continue}if(n.quotes===1&&s!=='"'){s=B.escapeRegex(s),r.value+=s,ut({value:s});continue}if(s==='"'){n.quotes=n.quotes===1?0:1,e.keepQuotes===!0&&g({type:"text",value:s});continue}if(s==="("){at("parens"),g({type:"paren",value:s});continue}if(s===")"){if(n.parens===0&&e.strictBrackets===!0)throw new SyntaxError(rt("opening","("));let i=b[b.length-1];if(i&&n.parens===i.parens+1){ne(b.pop());continue}g({type:"paren",value:s,output:n.parens?")":"\\)"}),tt("parens");continue}if(s==="["){if(e.nobracket===!0||!Q().includes("]")){if(e.nobracket!==!0&&e.strictBrackets===!0)throw new SyntaxError(rt("closing","]"));s=\${s}}else at("brackets");g({type:"bracket",value:s});continue}if(s==="]"){if(e.nobracket===!0||r&&r.type==="bracket"&&r.value.length===1){g({type:"text",value:s,output:\${s}});continue}if(n.brackets===0){if(e.strictBrackets===!0)throw new SyntaxError(rt("opening","["));g({type:"text",value:s,output:\${s}});continue}tt("brackets");let i=r.value.slice(1);if(r.posix!==!0&&i[0]==="^"&&!i.includes("/")&&(s=/${s}),r.value+=s,ut({value:s}),e.literalBrackets===!1||B.hasRegexChars(i))continue;let _=B.escapeRegex(r.value);if(n.output=n.output.slice(0,-r.value.length),e.literalBrackets===!0){n.output+=_,r.value=_;continue}r.value=(${f}${}|${r.value})`,n.output+=r.value;continue}if(s==="{"&&e.nobrace!==!0){at("braces");let i={type:"brace",value:s,output:"(",outputIndex:n.output.length,tokensIndex:n.tokens.length};$.push(i),g(i);continue}if(s==="}"){let i=$[$.length-1];if(e.nobrace===!0||!i){g({type:"text",value:s,output:s});continue}let =")";if(i.dots===!0){let C=l.slice(),M=[];for(let w=C.length-1;w>=0&&(l.pop(),C[w].type!=="brace");w--)C[w].type!=="dots"&&M.unshift(C[w].value);=Ge(M,e),n.backtrack=!0}if(i.comma!==!0&&i.dots!==!0){let C=n.output.slice(0,i.outputIndex),M=n.tokens.slice(i.tokensIndex);i.value=i.output="\{",s=="\}",n.output=C;for(let w of M)n.output+=w.output||w.value}g({type:"brace",value:s,output:}),tt("braces"),$.pop();continue}if(s==="|"){b.length>0&&b[b.length-1].conditions++,g({type:"text",value:s});continue}if(s===","){let i=s,=$[$.length-1];&&Y[Y.length-1]==="braces"&&(.comma=!0,i="|"),g({type:"comma",value:s,output:i});continue}if(s==="/"){if(r.type==="dot"&&n.index===n.start+1){n.start=n.index+1,n.consumed="",n.output="",l.pop(),r=y;continue}g({type:"slash",value:s,output:T});continue}if(s==="."){if(n.braces>0&&r.type==="dot"){r.value==="."&&(r.output=E);let i=$[$.length-1];r.type="dots",r.output+=s,r.value+=s,i.dots=!0;continue}if(n.braces+n.parens===0&&r.type!=="bos"&&r.type!=="slash"){g({type:"text",value:s,output:E});continue}g({type:"dot",value:s,output:E});continue}if(s==="?"){if(!(r&&r.value==="(")&&e.noextglob!==!0&&m()==="("&&m(2)!=="?"){lt("qmark",s);continue}if(r&&r.type==="paren"){let =m(),C=s;if(==="<"&&!B.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(r.value==="("&&!/[!=<:]/.test()||==="<"&&!/<([!=]|\w+>)/.test(Q()))&&(C=\\${s}),g({type:"text",value:s,output:C});continue}if(e.dot!==!0&&(r.type==="slash"||r.type==="bos")){g({type:"qmark",value:s,output:q});continue}g({type:"qmark",value:s,output:O});continue}if(s==="!"){if(e.noextglob!==!0&&m()==="("&&(m(2)!=="?"||!/[!=<:]/.test(m(3)))){lt("negate",s);continue}if(e.nonegate!==!0&&n.index===0){se();continue}}if(s==="+"){if(e.noextglob!==!0&&m()==="("&&m(2)!=="?"){lt("plus",s);continue}if(r&&r.value==="("||e.regex===!1){g({type:"plus",value:s,output:v});continue}if(r&&(r.type==="bracket"||r.type==="paren"||r.type==="brace")||n.parens>0){g({type:"plus",value:s});continue}g({type:"plus",value:v});continue}if(s==="@"){if(e.noextglob!==!0&&m()==="("&&m(2)!=="?"){g({type:"at",extglob:!0,value:s,output:""});continue}g({type:"text",value:s});continue}if(s!==""){(s==="$"||s==="^")&&(s=\\${s});let i=Me.exec(Q());i&&(s+=i[0],n.index+=i[0].length),g({type:"text",value:s});continue}if(r&&(r.type==="globstar"||r.star===!0)){r.type="star",r.star=!0,r.value+=s,r.output=I,n.backtrack=!0,n.globstar=!0,G(s);continue}let u=Q();if(e.noextglob!==!0&&/^([^?]/.test(u)){lt("star",s);continue}if(r.type==="star"){if(e.noglobstar===!0){G(s);continue}let i=r.prev,=i.prev,C=i.type==="slash"||i.type==="bos",M=&&(.type==="star"||.type==="globstar");if(e.bash===!0&&(!C||u[0]&&u[0]!=="/")){g({type:"star",value:s,output:""});continue}let w=n.braces>0&&(i.type==="comma"||i.type==="brace"),At=b.length&&(i.type==="pipe"||i.type==="paren");if(!C&&i.type!=="paren"&&!w&&!At){g({type:"star",value:s,output:""});continue}for(;u.slice(0,3)==="/";){let ct=t[n.index+4];if(ct&&ct!=="/")break;u=u.slice(3),G("/",3)}if(i.type==="bos"&&D()){r.type="globstar",r.value+=s,r.output=P(e),n.output=r.output,n.globstar=!0,G(s);continue}if(i.type==="slash"&&i.prev.type!=="bos"&&!M&&D()){n.output=n.output.slice(0,-(i.output+r.output).length),i.output=(?:${i.output},r.type="globstar",r.output=P(e)+(e.strictSlashes?")":"|$)"),r.value+=s,n.globstar=!0,n.output+=i.output+r.output,G(s);continue}if(i.type==="slash"&&i.prev.type!=="bos"&&u[0]==="/"){let ct=u[1]!==void 0?"|$":"";n.output=n.output.slice(0,-(i.output+r.output).length),i.output=(?:${i.output},r.type="globstar",r.output=${P(e)}${T}|${T}${ct}),r.value+=s,n.output+=i.output+r.output,n.globstar=!0,G(s+X()),g({type:"slash",value:"/",output:""});continue}if(i.type==="bos"&&u[0]==="/"){r.type="globstar",r.value+=s,r.output=(?:^|${T}|${P(e)}${T}),n.output=r.output,n.globstar=!0,G(s+X()),g({type:"slash",value:"/",output:""});continue}n.output=n.output.slice(0,-r.output.length),r.type="globstar",r.output=P(e),r.value+=s,n.output+=r.output,n.globstar=!0,G(s);continue}let x={type:"star",value:s,output:I};if(e.bash===!0){x.output=".?",(r.type==="bos"||r.type==="slash")&&(x.output=h+x.output),g(x);continue}if(r&&(r.type==="bracket"||r.type==="paren")&&e.regex===!0){x.output=s,g(x);continue}(n.index===n.start||r.type==="slash"||r.type==="dot")&&(r.type==="dot"?(n.output+=K,r.output+=K):e.dot===!0?(n.output+=U,r.output+=U):(n.output+=h,r.output+=h),m()!==""&&(n.output+=d,r.output+=d)),g(x)}for(;n.brackets>0;){if(e.strictBrackets===!0)throw new SyntaxError(rt("closing","]"));n.output=B.escapeLast(n.output,"["),tt("brackets")}for(;n.parens>0;){if(e.strictBrackets===!0)throw new SyntaxError(rt("closing",")"));n.output=B.escapeLast(n.output,"("),tt("parens")}for(;n.braces>0;){if(e.strictBrackets===!0)throw new SyntaxError(rt("closing","}"));n.output=B.escapeLast(n.output,"{"),tt("braces")}if(e.strictSlashes!==!0&&(r.type==="star"||r.type==="bracket")&&g({type:"maybe_slash",value:"",output:${T}?}),n.backtrack===!0){n.output="";for(let u of n.tokens)n.output+=u.output!=null?u.output:u.value,u.suffix&&(n.output+=u.suffix)}return n};xt.fastpaths=(t,o)=>{let e={...o},c=typeof e.maxLength=="number"?Math.min(yt,e.maxLength):yt,a=t.length;if(a>c)throw new SyntaxError(Input length: ${a}, exceeds maximum allowed length: ${c});t=Bt[t]||t;let y=B.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:R,NO_DOT:A,NO_DOTS:E,NO_DOTS_SLASH:v,STAR:T,START_ANCHOR:d}=ht.globChars(y),H=e.dot?E:A,z=e.dot?v:A,K=e.capture?"":"?:",U={negated:!1,prefix:""},O=e.bash===!0?".?":T;e.capture&&(O=(${O}));let q=h=>h.noglobstar===!0?O:(${K}(?:(?!${d}${h.dot?R:l}).)*?),N=h=>{switch(h){case"":return${H}${p}${O};case".":return${l}${p}${O};case".":return${H}${O}${l}${p}${O};case"/":return${H}${O}${f}${p}${z}${O};case"":return H+q(e);case"/*":return(?:${H}${q(e)}${f})?${z}${p}${O};case"/.":return(?:${H}${q(e)}${f})?${z}${O}${l}${p}${O};case"/.":return(?:${H}${q(e)}${f})?${l}${p}${O};default:{let S=/^(.?).(\w+)$/.exec(h);if(!S)return;let I=N(S[1]);return I?I+l+S[2]:void 0}}},Z=B.removePrefix(t,U),P=N(Z);return P&&e.strictSlashes!==!0&&(P+=${f}?),P};Ut.exports=xt});var Xt=et((hr,qt)=>{"use strict";k();var Be=nt("path"),Ue=Gt(),bt=Kt(),Ct=ft(),Ke=ot(),qe=t=>t&&typeof t=="object"&&!Array.isArray(t),L=(t,o,e=!1)=>{if(Array.isArray(t)){let A=t.map(v=>L(v,o,e));return v=>{for(let T of A){let d=T(v);if(d)return d}return!1}}let c=qe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");let a=o||{},y=Ct.isWindows(o),l=c?L.compileRe(t,o):L.makeRe(t,o,!1,!0),f=l.state;delete l.state;let p=()=>!1;if(a.ignore){let A={...o,ignore:null,onMatch:null,onResult:null};p=L(a.ignore,A,e)}let R=(A,E=!1)=>{let{isMatch:v,match:T,output:d}=L.test(A,l,o,{glob:t,posix:y}),H={glob:t,state:f,regex:l,posix:y,input:A,output:d,match:T,isMatch:v};return typeof a.onResult=="function"&&a.onResult(H),v===!1?(H.isMatch=!1,E?H:!1):p(A)?(typeof a.onIgnore=="function"&&a.onIgnore(H),H.isMatch=!1,E?H:!1):(typeof a.onMatch=="function"&&a.onMatch(H),E?H:!0)};return e&&(R.state=f),R};L.test=(t,o,e,{glob:c,posix:a}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let y=e||{},l=y.format||(a?Ct.toPosixSlashes:null),f=t===c,p=f&&l?l(t):t;return f===!1&&(p=l?l(t):t,f=p===c),(f===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?f=L.matchBase(t,o,e,a):f=o.exec(p)),{isMatch:Boolean(f),match:f,output:p}};L.matchBase=(t,o,e,c=Ct.isWindows(e))=>(o instanceof RegExp?o:L.makeRe(o,e)).test(Be.basename(t));L.isMatch=(t,o,e)=>L(o,e)(t);L.parse=(t,o)=>Array.isArray(t)?t.map(e=>L.parse(e,o)):bt(t,{...o,fastpaths:!1});L.scan=(t,o)=>Ue(t,o);L.compileRe=(t,o,e=!1,c=!1)=>{if(e===!0)return t.output;let a=o||{},y=a.contains?"":"^",l=a.contains?"":"$",f=${y}(?:${t.output})${l};t&&t.negated===!0&&(f=^(?!${f}).*$);let p=L.toRegex(f,o);return c===!0&&(p.state=t),p};L.makeRe=(t,o={},e=!1,c=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let a={negated:!1,fastpaths:!0};return o.fastpaths!==!1&&(t[0]==="."||t[0]==="")&&(a.output=bt.fastpaths(t,o)),a.output||(a=bt(t,o)),L.compileRe(a,o,e,c)};L.toRegex=(t,o)=>{try{let e=o||{};return new RegExp(t,e.flags||(e.nocase?"i":""))}catch(e){if(o&&o.debug===!0)throw e;return/$^/}};L.constants=Ke;qt.exports=L});var Vt=et((Ar,Qt)=>{"use strict";k();Qt.exports=Xt()});k();k();var Zt=_t(Vt(),1);import{extname: gr,win32: Xe,posix: zt,isAbsolute: Qe,resolve: Ve}from"path";function We(t){return Array.isArray(t)}function Wt(t){return We(t)?t:t==null?[]:[t]}var st=function(o){return o.split(Xe.sep).join(zt.sep)};function ze(t,o){if(o===!1||Qe(t)||t.startsWith(""))return st(t);let e=st(Ve(o||"")).replace(/[-^$*+?.()|[]{}]/g,"\$&");return zt.join(e,st(t))}var Yt=function(o,e,c){let a=c&&c.resolve,y=p=>p instanceof RegExp?p:{test:R=>{let A=ze(p,a);return(0,Zt.default)(A,{dot:!0})(R)}},l=Wt(o).map(y),f=Wt(e).map(y);return function(R){if(typeof R!="string"||/\0/.test(R))return!1;let A=st(R);for(let E=0;E<f.length;++E)if(f[E].test(A))return!1;for(let E=0;E<l.length;++E)if(l[E].test(A))return!0;return!l.length}},Ze="break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public",Ye="arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl",Je=new Set(${Ze} ${Ye}.split(" "));Je.add("");k();import{resolve: je}from"path";import{formatters: tr}from"stylelint";var Jt=t=>t.startsWith("virtual:")||t.startsWith("\0")||!t.includes("/"),jt=({cache:t,cacheLocation:o,include:e,exclude:c,stylelintPath:a,formatter:y,lintOnStart:l,emitError:f,emitErrorAsWarning:p,emitWarning:R,emitWarningAsError:A},{cacheDir:E})=>({cache:t!=null?t:!0,cacheLocation:o!=null?o:je(E,"vite-plugin-stylelint"),include:e!=null?e:["src/*/.{css,scss,sass,less,styl,vue,svelte}"],exclude:c!=null?c:["node_modules","virtual:"],stylelintPath:a!=null?a:"stylelint",formatter:y!=null?y:"string",lintOnStart:l!=null?l:!1,emitError:f!=null?f:!0,emitErrorAsWarning:p!=null?p:!1,emitWarning:R!=null?R:!0,emitWarningAsError:A!=null?A:!1}),te=t=>Yt(t.include,t.exclude),er=t=>({...t,allowEmptyInput:!0,cache:t.cache,cacheLocation:t.cacheLocation,files:t.files}),ee=async(t,o)=>{var e;try{let a=(await Promise.resolve().then(()=>_t(nt(t.stylelintPath)))).default,y=typeof t.formatter=="string"?tr[t.formatter]:t.formatter;return{stylelint:a,formatter:y}}catch(c){console.log(""),o.error(${(e=c==null?void 0:c.message)!=null?e:"Failed to import Stylelint. Have you installed and configured correctly?"})}},re=(t,o,e)=>{let{emitError:c,emitErrorAsWarning:a,emitWarning:y,emitWarningAsError:l}=e;return async(f,p)=>await t.lint({...er(e),files:p}).then(async R=>{if(!R)return;R.results.filter(E=>!E.ignored).forEach(E=>{E.warnings.forEach(({severity:v})=>{let T=o([E],R);v==="error"&&c&&(a?f.warn(T):f.error(T)),v==="warning"&&y&&(l?f.error(T):f.warn(T))})})}).catch(R=>{var A;console.log(""),f.error(${(A=R==null?void 0:R.message)!=null?A:R})})};function rr(t={}){let o,e,c,a,y;return{name:"vite:stylelint",configResolved(l){o=jt(t,l),e=te(o)},async buildStart(){if(!c){let l=await ee(o,this);c=l.stylelint,a=l.formatter,y=re(c,a,o)}o.lintOnStart&&(console.log(""),this.warn("Stylelint is linting all files in the project because lintOnStart is true. This will significantly slow down Vite."),await y(this,o.include))},async transform(l,f){let p=st(f).split("?")[0];return!e(p)||Jt(f)||await y(this,p),null}}}export{rr: default} = pkg;

at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
at async loadConfigFromBundledFile (file:///home/ian/templates/react/node_modules/.pnpm/vite@3.2.4_o42f5iwzzvdvf2ggobrzhmqgse/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:62832:21)
at async loadConfigFromFile (file:///home/ian/templates/react/node_modules/.pnpm/vite@3.2.4_o42f5iwzzvdvf2ggobrzhmqgse/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:62717:28)
at async resolveConfig (file:///home/ian/templates/react/node_modules/.pnpm/vite@3.2.4_o42f5iwzzvdvf2ggobrzhmqgse/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:62341:28)
at async createServer (file:///home/ian/templates/react/node_modules/.pnpm/vite@3.2.4_o42f5iwzzvdvf2ggobrzhmqgse/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:61641:20)
at async CAC.<anonymous> (file:///home/ian/templates/react/node_modules/.pnpm/vite@3.2.4_o42f5iwzzvdvf2ggobrzhmqgse/node_modules/vite/dist/node/cli.js:707:24)

 ELIFECYCLE  Command failed with exit code 1.

ModyQyW commented 1 year ago

Thanks for your report! Can you please try v3.1.1? @PineappleLee @ianzone

PineappleLee commented 1 year ago

I just try v3.1.1, and it works ok, good @ModyQyW

ModyQyW commented 1 year ago

I assume @ianzone is also ok then. Tell me if not.

I am closing this issue, and feel free to open a new issue if you find a new problem. ❤