@umijs/preset-vue 4.0.0-canary-20240513.3
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/README.md +3 -0
- package/compiled/@vitejs/plugin-vue/LICENSE +21 -0
- package/compiled/@vitejs/plugin-vue/index.js +1 -0
- package/compiled/@vitejs/plugin-vue/package.json +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +30 -0
- package/dist/features/config/assetRules.d.ts +8 -0
- package/dist/features/config/assetRules.js +43 -0
- package/dist/features/config/config.d.ts +3 -0
- package/dist/features/config/config.js +52 -0
- package/dist/features/default.d.ts +3 -0
- package/dist/features/default.js +99 -0
- package/dist/features/tmpFiles/tmpFiles.d.ts +3 -0
- package/dist/features/tmpFiles/tmpFiles.js +90 -0
- package/dist/features/vite/vite.d.ts +3 -0
- package/dist/features/vite/vite.js +47 -0
- package/dist/features/vueBabelLoaderCustomize.d.ts +4 -0
- package/dist/features/vueBabelLoaderCustomize.js +41 -0
- package/dist/features/webpack.d.ts +3 -0
- package/dist/features/webpack.js +47 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +54 -0
- package/dist/requireHook.d.ts +2 -0
- package/dist/requireHook.js +64 -0
- package/dist/utils/resolveProjectDep.d.ts +10 -0
- package/dist/utils/resolveProjectDep.js +60 -0
- package/package.json +56 -0
- package/templates/history.tpl +16 -0
- package/templates/useAppData.tpl +11 -0
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){"use strict";var e={975:function(e){e.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":e.length===1?"-":"--";const s=t.indexOf(r+e);const n=t.indexOf("--");return s!==-1&&(n===-1||s<n)}},242:function(e,t,r){const s=r(37);const n=r(224);const o=r(975);const{env:c}=process;let i;if(o("no-color")||o("no-colors")||o("color=false")||o("color=never")){i=0}else if(o("color")||o("colors")||o("color=true")||o("color=always")){i=1}if("FORCE_COLOR"in c){if(c.FORCE_COLOR==="true"){i=1}else if(c.FORCE_COLOR==="false"){i=0}else{i=c.FORCE_COLOR.length===0?1:Math.min(parseInt(c.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(i===0){return 0}if(o("color=16m")||o("color=full")||o("color=truecolor")){return 3}if(o("color=256")){return 2}if(e&&!t&&i===undefined){return 0}const r=i||0;if(c.TERM==="dumb"){return r}if(process.platform==="win32"){const e=s.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in c){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in c))||c.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in c){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(c.TEAMCITY_VERSION)?1:0}if(c.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in c){const e=parseInt((c.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(c.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(c.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(c.TERM)){return 1}if("COLORTERM"in c){return 1}return r}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,n.isatty(1))),stderr:translateLevel(supportsColor(true,n.isatty(2)))}},291:function(e){e.exports=require("@umijs/bundler-vite/compiled/vite")},5:function(e){e.exports=require("crypto")},561:function(e){e.exports=require("fs")},33:function(e){e.exports=require("module")},411:function(e){e.exports=require("path")},37:function(e){e.exports=require("os")},224:function(e){e.exports=require("tty")},310:function(e){e.exports=require("url")},837:function(e){e.exports=require("util")},762:function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});const s=r(561);const n=r(291);const o=r(33);const c=r(411);const i=r(5);const l=r(224);const u=r(837);function resolveCompiler(e){const t=tryResolveCompiler(e)||tryResolveCompiler();if(!t){throw new Error(`Failed to resolve vue/compiler-sfc.\n@vitejs/plugin-vue requires vue (>=3.2.25) to be present in the dependency tree.`)}return t}function tryResolveCompiler(e){const t=tryRequire("vue/package.json",e);if(t&&t.version.split(".")[0]>=3){return tryRequire("vue/compiler-sfc",e)}}const a=o.createRequire(typeof document==="undefined"?new(r(310).URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("index.cjs",document.baseURI).href);function tryRequire(e,t){try{return t?a(a.resolve(e,{paths:[t]})):a(e)}catch(e){}}function parseVueRequest(e){const[t,r]=e.split(`?`,2);const s=Object.fromEntries(new URLSearchParams(r));if(s.vue!=null){s.vue=true}if(s.index!=null){s.index=Number(s.index)}if(s.raw!=null){s.raw=true}if(s.url!=null){s.url=true}if(s.scoped!=null){s.scoped=true}return{filename:t,query:s}}function slash(e){const t=/^\\\\\?\\/.test(e);if(t){return e}return e.replace(/\\/g,"/")}const f=new Map;const p=new Map;function createDescriptor(e,t,{root:r,isProduction:s,sourceMap:n,compiler:o}){const{descriptor:i,errors:l}=o.parse(t,{filename:e,sourceMap:n});const u=slash(c.normalize(c.relative(r,e)));i.id=getHash(u+(s?t:""));f.set(e,i);return{descriptor:i,errors:l}}function getPrevDescriptor(e){return p.get(e)}function setPrevDescriptor(e,t){p.set(e,t)}function getDescriptor(e,t,r=true){if(f.has(e)){return f.get(e)}if(r){const{descriptor:r,errors:n}=createDescriptor(e,s.readFileSync(e,"utf-8"),t);if(n.length){throw n[0]}return r}}function getSrcDescriptor(e,t){if(t.scoped){return f.get(`${e}?src=${t.src}`)}return f.get(e)}function setSrcDescriptor(e,t,r){if(r){f.set(`${e}?src=${t.id}`,t);return}f.set(e,t)}function getHash(e){return i.createHash("sha256").update(e).digest("hex").substring(0,8)}function createRollupError(e,t){const{message:r,name:s,stack:n}=t;const o={id:e,plugin:"vue",message:r,name:s,stack:n};if("code"in t&&t.loc){o.loc={file:e,line:t.loc.start.line,column:t.loc.start.column}}return o}async function transformTemplateAsModule(e,t,r,s,n){const o=compile(e,t,r,s,n);let c=o.code;if(r.devServer&&r.devServer.config.server.hmr!==false&&!n&&!r.isProduction){c+=`\nimport.meta.hot.accept(({ render }) => {\n __VUE_HMR_RUNTIME__.rerender(${JSON.stringify(t.id)}, render)\n })`}return{code:c,map:o.map}}function transformTemplateInMain(e,t,r,s,n){const o=compile(e,t,r,s,n);return{...o,code:o.code.replace(/\nexport (function|const) (render|ssrRender)/,"\n$1 _sfc_$2")}}function compile(e,t,r,s,n){const o=t.filename;const c=r.compiler.compileTemplate({...resolveTemplateCompilerOptions(t,r,n),source:e});if(c.errors.length){c.errors.forEach((e=>s.error(typeof e==="string"?{id:o,message:e}:createRollupError(o,e))))}if(c.tips.length){c.tips.forEach((e=>s.warn({id:o,message:e})))}return c}function resolveTemplateCompilerOptions(e,t,r){const s=e.template;if(!s){return}const n=getResolvedScript(e,r);const o=e.styles.some((e=>e.scoped));const{id:i,filename:l,cssVars:u}=e;let a=t.template?.transformAssetUrls;let f;if(t.devServer){if(l.startsWith(t.root)){const e=t.devServer.config.base;f={base:(t.devServer.config.server?.origin??"")+e+slash(c.relative(t.root,c.dirname(l)))}}}else if(a!==false){f={includeAbsolute:true}}if(a&&typeof a==="object"){if(Object.values(a).some((e=>Array.isArray(e)))){a={...f,tags:a}}else{a={...f,...a}}}else{a=f}let p=s.lang&&t.template?.preprocessOptions;if(s.lang==="pug"){p={doctype:"html",...p}}const d=t.template?.compilerOptions?.expressionPlugins||[];const m=e.scriptSetup?.lang||e.script?.lang;if(m&&/tsx?$/.test(m)&&!d.includes("typescript")){d.push("typescript")}return{...t.template,id:i,filename:l,scoped:o,slotted:e.slotted,isProd:t.isProduction,inMap:s.src?void 0:s.map,ssr:r,ssrCssVars:u,transformAssetUrls:a,preprocessLang:s.lang,preprocessOptions:p,compilerOptions:{...t.template?.compilerOptions,scopeId:o?`data-v-${i}`:void 0,bindingMetadata:n?n.bindings:void 0,expressionPlugins:d,sourceMap:t.sourceMap}}}const d=new WeakMap;const m=new WeakMap;function getResolvedScript(e,t){return(t?m:d).get(e)}function setResolvedScript(e,t,r){(r?m:d).set(e,t)}function isUseInlineTemplate(e,t){return t&&!!e.scriptSetup&&!e.template?.src}function resolveScript(e,t,r){if(!e.script&&!e.scriptSetup){return null}const s=r?m:d;const n=s.get(e);if(n){return n}let o=null;o=t.compiler.compileScript(e,{...t.script,id:e.id,isProd:t.isProduction,inlineTemplate:isUseInlineTemplate(e,!t.devServer),reactivityTransform:t.reactivityTransform!==false,templateOptions:resolveTemplateCompilerOptions(e,t,r),sourceMap:t.sourceMap});s.set(e,o);return o}const g=",".charCodeAt(0);const h=";".charCodeAt(0);const y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";const C=new Uint8Array(64);const v=new Uint8Array(128);for(let e=0;e<y.length;e++){const t=y.charCodeAt(e);C[e]=t;v[t]=e}const _=typeof TextDecoder!=="undefined"?new TextDecoder:typeof Buffer!=="undefined"?{decode(e){const t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return t.toString()}}:{decode(e){let t="";for(let r=0;r<e.length;r++){t+=String.fromCharCode(e[r])}return t}};function decode(e){const t=new Int32Array(5);const r=[];let s=0;do{const n=indexOf(e,s);const o=[];let c=true;let i=0;t[0]=0;for(let r=s;r<n;r++){let s;r=decodeInteger(e,r,t,0);const l=t[0];if(l<i)c=false;i=l;if(hasMoreVlq(e,r,n)){r=decodeInteger(e,r,t,1);r=decodeInteger(e,r,t,2);r=decodeInteger(e,r,t,3);if(hasMoreVlq(e,r,n)){r=decodeInteger(e,r,t,4);s=[l,t[1],t[2],t[3],t[4]]}else{s=[l,t[1],t[2],t[3]]}}else{s=[l]}o.push(s)}if(!c)sort(o);r.push(o);s=n+1}while(s<=e.length);return r}function indexOf(e,t){const r=e.indexOf(";",t);return r===-1?e.length:r}function decodeInteger(e,t,r,s){let n=0;let o=0;let c=0;do{const r=e.charCodeAt(t++);c=v[r];n|=(c&31)<<o;o+=5}while(c&32);const i=n&1;n>>>=1;if(i){n=-2147483648|-n}r[s]+=n;return t}function hasMoreVlq(e,t,r){if(t>=r)return false;return e.charCodeAt(t)!==g}function sort(e){e.sort(sortComparator$1)}function sortComparator$1(e,t){return e[0]-t[0]}function encode(e){const t=new Int32Array(5);const r=1024*16;const s=r-36;const n=new Uint8Array(r);const o=n.subarray(0,s);let c=0;let i="";for(let l=0;l<e.length;l++){const u=e[l];if(l>0){if(c===r){i+=_.decode(n);c=0}n[c++]=h}if(u.length===0)continue;t[0]=0;for(let e=0;e<u.length;e++){const r=u[e];if(c>s){i+=_.decode(o);n.copyWithin(0,s,c);c-=s}if(e>0)n[c++]=g;c=encodeInteger(n,c,t,r,0);if(r.length===1)continue;c=encodeInteger(n,c,t,r,1);c=encodeInteger(n,c,t,r,2);c=encodeInteger(n,c,t,r,3);if(r.length===4)continue;c=encodeInteger(n,c,t,r,4)}}return i+_.decode(n.subarray(0,c))}function encodeInteger(e,t,r,s,n){const o=s[n];let c=o-r[n];r[n]=o;c=c<0?-c<<1|1:c<<1;do{let r=c&31;c>>>=5;if(c>0)r|=32;e[t++]=C[r]}while(c>0);return t}const b=/^[\w+.-]+:\/\//;const S=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;const R=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;var x;(function(e){e[e["Empty"]=1]="Empty";e[e["Hash"]=2]="Hash";e[e["Query"]=3]="Query";e[e["RelativePath"]=4]="RelativePath";e[e["AbsolutePath"]=5]="AbsolutePath";e[e["SchemeRelative"]=6]="SchemeRelative";e[e["Absolute"]=7]="Absolute"})(x||(x={}));function isAbsoluteUrl(e){return b.test(e)}function isSchemeRelativeUrl(e){return e.startsWith("//")}function isAbsolutePath(e){return e.startsWith("/")}function isFileUrl(e){return e.startsWith("file:")}function isRelative(e){return/^[.?#]/.test(e)}function parseAbsoluteUrl(e){const t=S.exec(e);return makeUrl(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/",t[6]||"",t[7]||"")}function parseFileUrl(e){const t=R.exec(e);const r=t[2];return makeUrl("file:","",t[1]||"","",isAbsolutePath(r)?r:"/"+r,t[3]||"",t[4]||"")}function makeUrl(e,t,r,s,n,o,c){return{scheme:e,user:t,host:r,port:s,path:n,query:o,hash:c,type:x.Absolute}}function parseUrl(e){if(isSchemeRelativeUrl(e)){const t=parseAbsoluteUrl("http:"+e);t.scheme="";t.type=x.SchemeRelative;return t}if(isAbsolutePath(e)){const t=parseAbsoluteUrl("http://foo.com"+e);t.scheme="";t.host="";t.type=x.AbsolutePath;return t}if(isFileUrl(e))return parseFileUrl(e);if(isAbsoluteUrl(e))return parseAbsoluteUrl(e);const t=parseAbsoluteUrl("http://foo.com/"+e);t.scheme="";t.host="";t.type=e?e.startsWith("?")?x.Query:e.startsWith("#")?x.Hash:x.RelativePath:x.Empty;return t}function stripPathFilename(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}function mergePaths(e,t){normalizePath(t,t.type);if(e.path==="/"){e.path=t.path}else{e.path=stripPathFilename(t.path)+e.path}}function normalizePath(e,t){const r=t<=x.RelativePath;const s=e.path.split("/");let n=1;let o=0;let c=false;for(let e=1;e<s.length;e++){const t=s[e];if(!t){c=true;continue}c=false;if(t===".")continue;if(t===".."){if(o){c=true;o--;n--}else if(r){s[n++]=t}continue}s[n++]=t;o++}let i="";for(let e=1;e<n;e++){i+="/"+s[e]}if(!i||c&&!i.endsWith("/..")){i+="/"}e.path=i}function resolve$1(e,t){if(!e&&!t)return"";const r=parseUrl(e);let s=r.type;if(t&&s!==x.Absolute){const e=parseUrl(t);const n=e.type;switch(s){case x.Empty:r.hash=e.hash;case x.Hash:r.query=e.query;case x.Query:case x.RelativePath:mergePaths(r,e);case x.AbsolutePath:r.user=e.user;r.host=e.host;r.port=e.port;case x.SchemeRelative:r.scheme=e.scheme}if(n>s)s=n}normalizePath(r,s);const n=r.query+r.hash;switch(s){case x.Hash:case x.Query:return n;case x.RelativePath:{const s=r.path.slice(1);if(!s)return n||".";if(isRelative(t||e)&&!isRelative(s)){return"./"+s+n}return s+n}case x.AbsolutePath:return r.path+n;default:return r.scheme+"//"+r.user+r.host+r.port+r.path+n}}function resolve(e,t){if(t&&!t.endsWith("/"))t+="/";return resolve$1(e,t)}function stripFilename(e){if(!e)return"";const t=e.lastIndexOf("/");return e.slice(0,t+1)}const w=0;function maybeSort(e,t){const r=nextUnsortedSegmentLine(e,0);if(r===e.length)return e;if(!t)e=e.slice();for(let s=r;s<e.length;s=nextUnsortedSegmentLine(e,s+1)){e[s]=sortSegments(e[s],t)}return e}function nextUnsortedSegmentLine(e,t){for(let r=t;r<e.length;r++){if(!isSorted(e[r]))return r}return e.length}function isSorted(e){for(let t=1;t<e.length;t++){if(e[t][w]<e[t-1][w]){return false}}return true}function sortSegments(e,t){if(!t)e=e.slice();return e.sort(sortComparator)}function sortComparator(e,t){return e[w]-t[w]}function memoizedState(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}let O;let F;class TraceMap{constructor(e,t){const r=typeof e==="string";if(!r&&e._decodedMemo)return e;const s=r?JSON.parse(e):e;const{version:n,file:o,names:c,sourceRoot:i,sources:l,sourcesContent:u}=s;this.version=n;this.file=o;this.names=c;this.sourceRoot=i;this.sources=l;this.sourcesContent=u;const a=resolve(i||"",stripFilename(t));this.resolvedSources=l.map((e=>resolve(e||"",a)));const{mappings:f}=s;if(typeof f==="string"){this._encoded=f;this._decoded=undefined}else{this._encoded=undefined;this._decoded=maybeSort(f,r)}this._decodedMemo=memoizedState();this._bySources=undefined;this._bySourceMemos=undefined}}(()=>{O=e=>e._decoded||(e._decoded=decode(e._encoded));F=(e,t)=>{const r=O(e);const{names:s,resolvedSources:n}=e;for(let e=0;e<r.length;e++){const o=r[e];for(let r=0;r<o.length;r++){const c=o[r];const i=e+1;const l=c[0];let u=null;let a=null;let f=null;let p=null;if(c.length!==1){u=n[c[1]];a=c[2]+1;f=c[3]}if(c.length===5)p=s[c[4]];t({generatedLine:i,generatedColumn:l,source:u,originalLine:a,originalColumn:f,name:p})}}}})();let E;let D;class SetArray{constructor(){this._indexes={__proto__:null};this.array=[]}}(()=>{E=(e,t)=>e._indexes[t];D=(e,t)=>{const r=E(e,t);if(r!==undefined)return r;const{array:s,_indexes:n}=e;return n[t]=s.push(t)-1}})();const $=0;const M=1;const I=2;const A=3;const T=4;const k=-1;let P;let U;let q;let N;let L;class GenMapping{constructor({file:e,sourceRoot:t}={}){this._names=new SetArray;this._sources=new SetArray;this._sourcesContent=[];this._mappings=[];this.file=e;this.sourceRoot=t}}(()=>{P=(e,t)=>addMappingInternal(false,e,t);U=e=>{const{file:t,sourceRoot:r,_mappings:s,_sources:n,_sourcesContent:o,_names:c}=e;removeEmptyFinalLines(s);return{version:3,file:t||undefined,names:c.array,sourceRoot:r||undefined,sources:n.array,sourcesContent:o,mappings:s}};q=e=>{const t=U(e);return Object.assign(Object.assign({},t),{mappings:encode(t.mappings)})};N=e=>{const t=new TraceMap(e);const r=new GenMapping({file:t.file,sourceRoot:t.sourceRoot});putAll(r._names,t.names);putAll(r._sources,t.sources);r._sourcesContent=t.sourcesContent||t.sources.map((()=>null));r._mappings=O(t);return r};L=(e,t,r,s,n,o,c,i,l)=>{const{_mappings:u,_sources:a,_sourcesContent:f,_names:p}=t;const d=getLine(u,r);const m=getColumnIndex(d,s);if(!n){if(e&&skipSourceless(d,m))return;return insert(d,m,[s])}const g=D(a,n);const h=i?D(p,i):k;if(g===f.length)f[g]=l!==null&&l!==void 0?l:null;if(e&&skipSource(d,m,g,o,c,h)){return}return insert(d,m,i?[s,g,o,c,h]:[s,g,o,c])}})();function getLine(e,t){for(let r=e.length;r<=t;r++){e[r]=[]}return e[t]}function getColumnIndex(e,t){let r=e.length;for(let s=r-1;s>=0;r=s--){const r=e[s];if(t>=r[$])break}return r}function insert(e,t,r){for(let r=e.length;r>t;r--){e[r]=e[r-1]}e[t]=r}function removeEmptyFinalLines(e){const{length:t}=e;let r=t;for(let t=r-1;t>=0;r=t,t--){if(e[t].length>0)break}if(r<t)e.length=r}function putAll(e,t){for(let r=0;r<t.length;r++)D(e,t[r])}function skipSourceless(e,t){if(t===0)return true;const r=e[t-1];return r.length===1}function skipSource(e,t,r,s,n,o){if(t===0)return false;const c=e[t-1];if(c.length===1)return false;return r===c[M]&&s===c[I]&&n===c[A]&&o===(c.length===5?c[T]:k)}function addMappingInternal(e,t,r){const{generated:s,source:n,original:o,name:c,content:i}=r;if(!n){return L(e,t,s.line-1,s.column,null,null,null,null,null)}const l=n;return L(e,t,s.line-1,s.column,l,o.line-1,o.column,c,i)}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var j={};var B={get exports(){return j},set exports(e){j=e}};var V={};var H={get exports(){return V},set exports(e){V=e}};var W;var J;function requireMs(){if(J)return W;J=1;var e=1e3;var t=e*60;var r=t*60;var s=r*24;var n=s*7;var o=s*365.25;W=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(c){c=String(c);if(c.length>100){return}var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(!i){return}var l=parseFloat(i[1]);var u=(i[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return l*o;case"weeks":case"week":case"w":return l*n;case"days":case"day":case"d":return l*s;case"hours":case"hour":case"hrs":case"hr":case"h":return l*r;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return undefined}}function fmtShort(n){var o=Math.abs(n);if(o>=s){return Math.round(n/s)+"d"}if(o>=r){return Math.round(n/r)+"h"}if(o>=t){return Math.round(n/t)+"m"}if(o>=e){return Math.round(n/e)+"s"}return n+"ms"}function fmtLong(n){var o=Math.abs(n);if(o>=s){return plural(n,o,s,"day")}if(o>=r){return plural(n,o,r,"hour")}if(o>=t){return plural(n,o,t,"minute")}if(o>=e){return plural(n,o,e,"second")}return n+" ms"}function plural(e,t,r,s){var n=t>=r*1.5;return Math.round(e/r)+" "+s+(n?"s":"")}return W}var z;var G;function requireCommon(){if(G)return z;G=1;function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=requireMs();createDebug.destroy=destroy;Object.keys(e).forEach((t=>{createDebug[t]=e[t]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r);t|=0}return createDebug.colors[Math.abs(t)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(e){let t;let r=null;let s;let n;function debug(...e){if(!debug.enabled){return}const r=debug;const s=Number(new Date);const n=s-(t||s);r.diff=n;r.prev=t;r.curr=s;t=s;e[0]=createDebug.coerce(e[0]);if(typeof e[0]!=="string"){e.unshift("%O")}let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,s)=>{if(t==="%%"){return"%"}o++;const n=createDebug.formatters[s];if(typeof n==="function"){const s=e[o];t=n.call(r,s);e.splice(o,1);o--}return t}));createDebug.formatArgs.call(r,e);const c=r.log||createDebug.log;c.apply(r,e)}debug.namespace=e;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(e);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(r!==null){return r}if(s!==createDebug.namespaces){s=createDebug.namespaces;n=createDebug.enabled(e)}return n},set:e=>{r=e}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(e,t){const r=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);r.log=this.log;return r}function enable(e){createDebug.save(e);createDebug.namespaces=e;createDebug.names=[];createDebug.skips=[];let t;const r=(typeof e==="string"?e:"").split(/[\s,]+/);const s=r.length;for(t=0;t<s;t++){if(!r[t]){continue}e=r[t].replace(/\*/g,".*?");if(e[0]==="-"){createDebug.skips.push(new RegExp("^"+e.slice(1)+"$"))}else{createDebug.names.push(new RegExp("^"+e+"$"))}}}function disable(){const e=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map((e=>"-"+e))].join(",");createDebug.enable("");return e}function enabled(e){if(e[e.length-1]==="*"){return true}let t;let r;for(t=0,r=createDebug.skips.length;t<r;t++){if(createDebug.skips[t].test(e)){return false}}for(t=0,r=createDebug.names.length;t<r;t++){if(createDebug.names[t].test(e)){return true}}return false}function toNamespace(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}function coerce(e){if(e instanceof Error){return e.stack||e.message}return e}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}createDebug.enable(createDebug.load());return createDebug}z=setup;return z}var Q;function requireBrowser(){if(Q)return V;Q=1;(function(e,t){t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.destroy=(()=>{let e=false;return()=>{if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0;let n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{if(e==="%%"){return}s++;if(e==="%c"){n=s}}));t.splice(n,0,r)}t.log=console.debug||console.log||(()=>{});function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=requireCommon()(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})(H,V);return V}var Y={};var K={get exports(){return Y},set exports(e){Y=e}};var Z;function requireNode(){if(Z)return Y;Z=1;(function(e,t){const s=l;const n=u;t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.destroy=n.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");t.colors=[6,2,3,4,5,1];try{const e=r(242);if(e&&(e.stderr||e).level>=2){t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let s=process.env[t];if(/^(yes|on|true|enabled)$/i.test(s)){s=true}else if(/^(no|off|false|disabled)$/i.test(s)){s=false}else if(s==="null"){s=null}else{s=Number(s)}e[r]=s;return e}),{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):s.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:r,useColors:s}=this;if(s){const s=this.color;const n="[3"+(s<8?s:"8;5;"+s);const o=` ${n};1m${r} [0m`;t[0]=o+t[0].split("\n").join("\n"+o);t.push(n+"m+"+e.exports.humanize(this.diff)+"[0m")}else{t[0]=getDate()+r+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(n.format(...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let s=0;s<r.length;s++){e.inspectOpts[r[s]]=t.inspectOpts[r[s]]}}e.exports=requireCommon()(t);const{formatters:o}=e.exports;o.o=function(e){this.inspectOpts.colors=this.useColors;return n.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")};o.O=function(e){this.inspectOpts.colors=this.useColors;return n.inspect(e,this.inspectOpts)}})(K,Y);return Y}(function(e){if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=requireBrowser()}else{e.exports=requireNode()}})(B);const X=getDefaultExportFromCjs(j);const ee=X("vite:hmr");const te=/(?:\?|&)direct\b/;async function handleHotUpdate({file:e,modules:t,read:r,server:s},o){const c=getDescriptor(e,o,false);if(!c){return}setPrevDescriptor(e,c);const i=await r();const{descriptor:l}=createDescriptor(e,i,o);let u=false;const a=new Set;const f=t.filter((e=>!/type=/.test(e.url)||/type=script/.test(e.url))).sort(((e,t)=>e.url.length-t.url.length))[0];const p=t.find((e=>/type=template/.test(e.url)));const d=hasScriptChanged(c,l);if(d){let e;if(l.scriptSetup?.lang&&!l.scriptSetup.src||l.script?.lang&&!l.script.src){const r=new RegExp(`type=script.*&lang.${l.scriptSetup?.lang||l.script?.lang}$`);e=t.find((e=>r.test(e.url)))}a.add(e||f)}if(!isEqualBlock(l.template,c.template)){if(!d){setResolvedScript(l,getResolvedScript(c,false),false)}a.add(p);u=true}let m=false;const g=c.styles||[];const h=l.styles||[];if(c.cssVars.join("")!==l.cssVars.join("")){a.add(f)}if(g.some((e=>e.scoped))!==h.some((e=>e.scoped))){a.add(p);a.add(f)}for(let e=0;e<h.length;e++){const r=g[e];const s=h[e];if(!r||!isEqualBlock(r,s)){m=true;const r=t.find((t=>t.url.includes(`type=style&index=${e}`)&&t.url.endsWith(`.${s.lang||"css"}`)&&!te.test(t.url)));if(r){a.add(r);if(r.url.includes("&inline")){a.add(f)}}else{a.add(f)}}}if(g.length>h.length){a.add(f)}const y=c.customBlocks||[];const C=l.customBlocks||[];if(y.length!==C.length){a.add(f)}else{for(let e=0;e<C.length;e++){const r=y[e];const s=C[e];if(!r||!isEqualBlock(r,s)){const s=t.find((t=>t.url.includes(`type=${r.type}&index=${e}`)));if(s){a.add(s)}else{a.add(f)}}}}const v=[];if(u){v.push(`template`);if(!p){a.add(f)}else if(f&&!a.has(f)){const e=[...f.importers].filter((e=>n.isCSSRequest(e.url)));e.forEach((e=>a.add(e)))}}if(m){v.push(`style`)}if(v.length){ee(`[vue:update(${v.join("&")})] ${e}`)}return[...a].filter(Boolean)}function isEqualBlock(e,t){if(!e&&!t)return true;if(!e||!t)return false;if(e.src&&t.src&&e.src===t.src)return true;if(e.content!==t.content)return false;const r=Object.keys(e.attrs);const s=Object.keys(t.attrs);if(r.length!==s.length){return false}return r.every((r=>e.attrs[r]===t.attrs[r]))}function isOnlyTemplateChanged(e,t){return!hasScriptChanged(e,t)&&e.styles.length===t.styles.length&&e.styles.every(((e,r)=>isEqualBlock(e,t.styles[r])))&&e.customBlocks.length===t.customBlocks.length&&e.customBlocks.every(((e,r)=>isEqualBlock(e,t.customBlocks[r])))}function hasScriptChanged(e,t){if(!isEqualBlock(e.script,t.script)){return true}if(!isEqualBlock(e.scriptSetup,t.scriptSetup)){return true}const r=getResolvedScript(e,false);const s=r?.imports;if(s){return!t.template||t.shouldForceReload(s)}return false}const re="\0plugin-vue:export-helper";const se=`\nexport default (sfc, props) => {\n const target = sfc.__vccOpts || sfc;\n for (const [key, val] of props) {\n target[key] = val;\n }\n return target;\n}\n`;async function transformMain(e,t,r,s,o,i){const{devServer:l,isProduction:u,devToolsEnabled:a}=r;const f=getPrevDescriptor(t);const{descriptor:p,errors:d}=createDescriptor(t,e,r);if(d.length){d.forEach((e=>s.error(createRollupError(t,e))));return null}const m=[];const g=p.styles.some((e=>e.scoped));const{code:h,map:y}=await genScriptCode(p,r,s,o);const C=p.template&&!isUseInlineTemplate(p,!l);let v="";let _=void 0;if(C){({code:v,map:_}=await genTemplateCode(p,r,s,o))}if(C){m.push(o?["ssrRender","_sfc_ssrRender"]:["render","_sfc_render"])}else{if(f&&!isEqualBlock(p.template,f.template)){m.push([o?"ssrRender":"render","() => {}"])}}const b=await genStyleCode(p,s,i,m);const S=await genCustomBlockCode(p,s);const R=[h,v,b,S];if(g){m.push([`__scopeId`,JSON.stringify(`data-v-${p.id}`)])}if(a||l&&!u){m.push([`__file`,JSON.stringify(u?c.basename(t):t)])}if(l&&l.config.server.hmr!==false&&!o&&!u){R.push(`_sfc_main.__hmrId = ${JSON.stringify(p.id)}`);R.push(`typeof __VUE_HMR_RUNTIME__ !== 'undefined' && __VUE_HMR_RUNTIME__.createRecord(_sfc_main.__hmrId, _sfc_main)`);if(f&&isOnlyTemplateChanged(f,p)){R.push(`export const _rerender_only = true`)}R.push(`import.meta.hot.accept(mod => {`,` if (!mod) return`,` const { default: updated, _rerender_only } = mod`,` if (_rerender_only) {`,` __VUE_HMR_RUNTIME__.rerender(updated.__hmrId, updated.render)`,` } else {`,` __VUE_HMR_RUNTIME__.reload(updated.__hmrId, updated)`,` }`,`})`)}if(o){const e=n.normalizePath(c.relative(r.root,t));R.push(`import { useSSRContext as __vite_useSSRContext } from 'vue'`,`const _sfc_setup = _sfc_main.setup`,`_sfc_main.setup = (props, ctx) => {`,` const ssrContext = __vite_useSSRContext()`,` ;(ssrContext.modules || (ssrContext.modules = new Set())).add(${JSON.stringify(e)})`,` return _sfc_setup ? _sfc_setup(props, ctx) : undefined`,`}`)}let x=void 0;if(r.sourceMap){if(y&&_){const e=N(y);const t=new TraceMap(_);const r=(h.match(/\r?\n/g)?.length??0)+1;F(t,(t=>{if(t.source==null)return;P(e,{source:t.source,original:{line:t.originalLine,column:t.originalColumn},generated:{line:t.generatedLine+r,column:t.generatedColumn}})}));x=q(e);x.sourcesContent=_.sourcesContent}else{x=y??_}}if(!m.length){R.push(`export default _sfc_main`)}else{R.push(`import _export_sfc from '${re}'`,`export default /*#__PURE__*/_export_sfc(_sfc_main, [${m.map((([e,t])=>`['${e}',${t}]`)).join(",")}])`)}let w=R.join("\n");const O=p.scriptSetup?.lang||p.script?.lang;if(O&&/tsx?$/.test(O)&&!p.script?.src){const{code:e,map:s}=await n.transformWithEsbuild(w,t,{loader:"ts",target:"esnext",sourcemap:r.sourceMap},x);w=e;x=x?s:x}return{code:w,map:x||{mappings:""},meta:{vite:{lang:p.script?.lang||p.scriptSetup?.lang||"js"}}}}async function genTemplateCode(e,t,r,s){const n=e.template;const o=e.styles.some((e=>e.scoped));if(!n.lang&&!n.src){return transformTemplateInMain(n.content,e,t,r,s)}else{if(n.src){await linkSrcToDescriptor(n.src,e,r,o)}const t=n.src||e.filename;const c=n.src?o?`&src=${e.id}`:"&src=true":"";const i=o?`&scoped=${e.id}`:``;const l=attrsToQuery(n.attrs,"js",true);const u=`?vue&type=template${c}${i}${l}`;const a=JSON.stringify(t+u);const f=s?"ssrRender":"render";return{code:`import { ${f} as _sfc_${f} } from ${a}`,map:void 0}}}async function genScriptCode(e,t,r,s){let n=`const _sfc_main = {}`;let o;const i=resolveScript(e,t,s);if(i){if((!i.lang||i.lang==="ts"&&t.devServer)&&!i.src){const e=t.script?.babelParserPlugins||[];const r=i.lang==="ts"?e.includes("decorators")?["typescript"]:["typescript","decorators-legacy"]:[];n=t.compiler.rewriteDefault(i.content,"_sfc_main",[...r,...e]);o=i.map}else{if(i.src){await linkSrcToDescriptor(i.src,e,r,false)}const t=i.src||e.filename;const s=i.src&&c.extname(t).slice(1)||"js";const o=attrsToQuery(i.attrs,s);const l=i.src?`&src=true`:``;const u=`?vue&type=script${l}${o}`;const a=JSON.stringify(t+u);n=`import _sfc_main from ${a}\nexport * from ${a}`}}return{code:n,map:o}}async function genStyleCode(e,t,r,s){let n=``;let o;if(e.styles.length){for(let s=0;s<e.styles.length;s++){const c=e.styles[s];if(c.src){await linkSrcToDescriptor(c.src,e,t,c.scoped)}const i=c.src||e.filename;const l=attrsToQuery(c.attrs,"css");const u=c.src?c.scoped?`&src=${e.id}`:"&src=true":"";const a=r?`&inline`:``;const f=c.scoped?`&scoped=${e.id}`:``;const p=`?vue&type=style&index=${s}${u}${a}${f}`;const d=i+p+l;if(c.module){if(r){throw new Error(`<style module> is not supported in custom elements mode.`)}const[e,t]=genCSSModulesCode(s,d,c.module);n+=e;Object.assign(o||(o={}),t)}else{if(r){n+=`\nimport _style_${s} from ${JSON.stringify(d)}`}else{n+=`\nimport ${JSON.stringify(d)}`}}}if(r){s.push([`styles`,`[${e.styles.map(((e,t)=>`_style_${t}`)).join(",")}]`])}}if(o){const e=Object.entries(o).reduce(((e,[t,r])=>e+`"${t}":${r},\n`),"{\n")+"}";n+=`\nconst cssModules = ${e}`;s.push([`__cssModules`,`cssModules`])}return n}function genCSSModulesCode(e,t,r){const s=`style${e}`;const n=typeof r==="string"?r:"$style";const o=t.replace(/\.(\w+)$/,".module.$1");return[`\nimport ${s} from ${JSON.stringify(o)}`,{[n]:s}]}async function genCustomBlockCode(e,t){let r="";for(let s=0;s<e.customBlocks.length;s++){const n=e.customBlocks[s];if(n.src){await linkSrcToDescriptor(n.src,e,t,false)}const o=n.src||e.filename;const c=attrsToQuery(n.attrs,n.type);const i=n.src?`&src=true`:``;const l=`?vue&type=${n.type}&index=${s}${i}${c}`;const u=JSON.stringify(o+l);r+=`import block${s} from ${u}\n`;r+=`if (typeof block${s} === 'function') block${s}(_sfc_main)\n`}return r}async function linkSrcToDescriptor(e,t,r,s){const n=(await r.resolve(e,t.filename))?.id||e;setSrcDescriptor(n.replace(/\?.*$/,""),t,s)}const ne=["id","index","src","type","lang","module","scoped"];function attrsToQuery(e,t,r=false){let s=``;for(const t in e){const r=e[t];if(!ne.includes(t)){s+=`&${encodeURIComponent(t)}${r?`=${encodeURIComponent(r)}`:``}`}}if(t||e.lang){s+=`lang`in e?r?`&lang.${t}`:`&lang.${e.lang}`:`&lang.${t}`}return s}async function transformStyle(e,t,r,s,o,c){const i=t.styles[r];const l=await s.compiler.compileStyleAsync({...s.style,filename:t.filename,id:`data-v-${t.id}`,isProd:s.isProduction,source:e,scoped:i.scoped,...s.cssDevSourcemap?{postcssOptions:{map:{from:c,inline:false,annotation:false}}}:{}});if(l.errors.length){l.errors.forEach((e=>{if(e.line&&e.column){e.loc={file:t.filename,line:e.line+i.loc.start.line,column:e.column}}o.error(e)}));return null}const u=l.map?await n.formatPostcssSourceMap(l.map,c):{mappings:""};return{code:l.code,map:u}}function vuePlugin(e={}){const{include:t=/\.vue$/,exclude:r,customElement:o=/\.ce\.vue$/,reactivityTransform:c=false}=e;const i=n.createFilter(t,r);const l=typeof o==="boolean"?()=>o:n.createFilter(o);const u=c===false?()=>false:c===true?n.createFilter(/\.(j|t)sx?$/,/node_modules/):n.createFilter(c);let a={isProduction:process.env.NODE_ENV==="production",compiler:null,...e,include:t,exclude:r,customElement:o,reactivityTransform:c,root:process.cwd(),sourceMap:true,cssDevSourcemap:false,devToolsEnabled:process.env.NODE_ENV!=="production"};return{name:"vite:vue",handleHotUpdate(e){if(!i(e.file)){return}return handleHotUpdate(e,a)},config(e){return{resolve:{dedupe:e.build?.ssr?[]:["vue"]},define:{__VUE_OPTIONS_API__:e.define?.__VUE_OPTIONS_API__??true,__VUE_PROD_DEVTOOLS__:e.define?.__VUE_PROD_DEVTOOLS__??false},ssr:{external:e.legacy?.buildSsrCjsExternalHeuristics?["vue","@vue/server-renderer"]:[]}}},configResolved(e){a={...a,root:e.root,sourceMap:e.command==="build"?!!e.build.sourcemap:true,cssDevSourcemap:e.css?.devSourcemap??false,isProduction:e.isProduction,devToolsEnabled:!!e.define.__VUE_PROD_DEVTOOLS__||!e.isProduction}},configureServer(e){a.devServer=e},buildStart(){a.compiler=a.compiler||resolveCompiler(a.root)},async resolveId(e){if(e===re){return e}if(parseVueRequest(e).query.vue){return e}},load(e,t){const r=t?.ssr===true;if(e===re){return se}const{filename:n,query:o}=parseVueRequest(e);if(o.vue){if(o.src){return s.readFileSync(n,"utf-8")}const e=getDescriptor(n,a);let t;if(o.type==="script"){t=getResolvedScript(e,r)}else if(o.type==="template"){t=e.template}else if(o.type==="style"){t=e.styles[o.index]}else if(o.index!=null){t=e.customBlocks[o.index]}if(t){return{code:t.content,map:t.map}}}},transform(e,t,r){const s=r?.ssr===true;const{filename:n,query:o}=parseVueRequest(t);if(o.raw||o.url){return}if(!i(n)&&!o.vue){if(!o.vue&&u(n)&&a.compiler.shouldTransformRef(e)){return a.compiler.transformRef(e,{filename:n,sourceMap:true})}return}if(!o.vue){return transformMain(e,n,a,this,s,l(n))}else{const t=o.src?getSrcDescriptor(n,o):getDescriptor(n,a);if(o.type==="template"){return transformTemplateAsModule(e,t,a,this,s)}else if(o.type==="style"){return transformStyle(e,t,Number(o.index),a,this,n)}}}}}e.exports=vuePlugin;e.exports["default"]=vuePlugin;e.exports.parseVueRequest=parseVueRequest}};var t={};function __nccwpck_require__(r){var s=t[r];if(s!==undefined){return s.exports}var n=t[r]={exports:{}};var o=true;try{e[r](n,n.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(762);module.exports=r})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@vitejs/plugin-vue","version":"4.1.0","author":"Evan You","license":"MIT","types":"./dist/index.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TEMPLATES_DIR: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/constants.ts
|
|
20
|
+
var constants_exports = {};
|
|
21
|
+
__export(constants_exports, {
|
|
22
|
+
TEMPLATES_DIR: () => TEMPLATES_DIR
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(constants_exports);
|
|
25
|
+
var import_path = require("path");
|
|
26
|
+
var TEMPLATES_DIR = (0, import_path.join)(__dirname, "../templates");
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
TEMPLATES_DIR
|
|
30
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/features/config/assetRules.ts
|
|
20
|
+
var assetRules_exports = {};
|
|
21
|
+
__export(assetRules_exports, {
|
|
22
|
+
addAssetRules: () => addAssetRules
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(assetRules_exports);
|
|
25
|
+
async function addAssetRules({ config, api }) {
|
|
26
|
+
config.module.rules.delete("asset");
|
|
27
|
+
const { userConfig } = api;
|
|
28
|
+
const inlineLimit = parseInt(userConfig.inlineLimit || "10000", 10);
|
|
29
|
+
config.module.rule("avif").test(/\.avif$/).type("asset").mimetype("image/avif").parser({
|
|
30
|
+
dataUrlCondition: {
|
|
31
|
+
maxSize: inlineLimit
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
config.module.rule("image").test(/\.(bmp|gif|jpg|jpeg|png|svg)$/).type("asset").parser({
|
|
35
|
+
dataUrlCondition: {
|
|
36
|
+
maxSize: inlineLimit
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
addAssetRules
|
|
43
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/features/config/config.ts
|
|
30
|
+
var config_exports = {};
|
|
31
|
+
__export(config_exports, {
|
|
32
|
+
getConfig: () => getConfig
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(config_exports);
|
|
35
|
+
var import_pluginWebpack5 = __toESM(require("vue-loader/dist/pluginWebpack5.js"));
|
|
36
|
+
var import_assetRules = require("./assetRules");
|
|
37
|
+
function getConfig(config, api) {
|
|
38
|
+
config.module.noParse(/^(vue|vue-router|vuex|vuex-router-sync)$/);
|
|
39
|
+
config.module.rule("esm").test(/\.m?jsx?$/).resolve.set("fullySpecified", false);
|
|
40
|
+
config.resolve.extensions.merge([".vue"]).end();
|
|
41
|
+
config.module.rule("vue").test(/\.vue$/).use("vue-loader").loader(require.resolve("vue-loader")).options({
|
|
42
|
+
babelParserPlugins: ["jsx", "classProperties", "decorators-legacy"]
|
|
43
|
+
});
|
|
44
|
+
config.plugin("vue-loader-plugin").use(import_pluginWebpack5.default);
|
|
45
|
+
config.module.rule("vue-style").test(/\.vue$/).resourceQuery(/type=style/).sideEffects(true);
|
|
46
|
+
config.module.rule("fix-element-ui-plus").test(/\.mjs$/).include.add(/node_modules/).end().type("javascript/auto").resolve.fullySpecified(false);
|
|
47
|
+
(0, import_assetRules.addAssetRules)({ api, config });
|
|
48
|
+
}
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
getConfig
|
|
52
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/features/default.ts
|
|
30
|
+
var default_exports = {};
|
|
31
|
+
__export(default_exports, {
|
|
32
|
+
default: () => default_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(default_exports);
|
|
35
|
+
var import_path = require("path");
|
|
36
|
+
var import_resolveProjectDep = require("../utils/resolveProjectDep");
|
|
37
|
+
var default_default = (api) => {
|
|
38
|
+
api.describe({
|
|
39
|
+
key: "preset-vue:default"
|
|
40
|
+
});
|
|
41
|
+
api.modifyDefaultConfig((config) => {
|
|
42
|
+
var _a;
|
|
43
|
+
const vuePath = (0, import_resolveProjectDep.resolveVuePath)({
|
|
44
|
+
pkg: api.pkg,
|
|
45
|
+
cwd: api.cwd,
|
|
46
|
+
path: "dist/vue.esm-bundler.js"
|
|
47
|
+
});
|
|
48
|
+
const vueRuntimePath = (0, import_resolveProjectDep.resolveVuePath)({
|
|
49
|
+
pkg: api.pkg,
|
|
50
|
+
cwd: api.cwd,
|
|
51
|
+
path: "dist/vue.runtime.esm-bundler.js"
|
|
52
|
+
});
|
|
53
|
+
config.alias = {
|
|
54
|
+
...config.alias,
|
|
55
|
+
vue: ((_a = api.userConfig.vue) == null ? void 0 : _a.runtimeCompiler) ? vuePath : vueRuntimePath,
|
|
56
|
+
"vue-router": (0, import_resolveProjectDep.resolveProjectDep)({
|
|
57
|
+
pkg: api.pkg,
|
|
58
|
+
cwd: api.cwd,
|
|
59
|
+
dep: "vue-router"
|
|
60
|
+
}) || (0, import_path.dirname)(require.resolve("vue-router/package.json"))
|
|
61
|
+
};
|
|
62
|
+
config.define = {
|
|
63
|
+
...config.define,
|
|
64
|
+
__VUE_OPTIONS_API__: true,
|
|
65
|
+
__VUE_PROD_DEVTOOLS__: false
|
|
66
|
+
};
|
|
67
|
+
return config;
|
|
68
|
+
});
|
|
69
|
+
api.modifyConfig((memo) => {
|
|
70
|
+
memo.fastRefresh = false;
|
|
71
|
+
memo.babelLoaderCustomize = require.resolve("./vueBabelLoaderCustomize");
|
|
72
|
+
memo.svgr = false;
|
|
73
|
+
return memo;
|
|
74
|
+
});
|
|
75
|
+
api.modifyAppData((memo) => {
|
|
76
|
+
memo.framework = "vue";
|
|
77
|
+
return memo;
|
|
78
|
+
});
|
|
79
|
+
api.modifyRendererPath(
|
|
80
|
+
() => (0, import_path.dirname)(require.resolve("@umijs/renderer-vue/package.json"))
|
|
81
|
+
);
|
|
82
|
+
api.modifyBabelPresetOpts((memo) => {
|
|
83
|
+
memo.presetTypeScript = {
|
|
84
|
+
// 支持 vue 后缀
|
|
85
|
+
allExtensions: true,
|
|
86
|
+
// 支持 tsx
|
|
87
|
+
isTSX: true
|
|
88
|
+
};
|
|
89
|
+
memo.presetReact = false;
|
|
90
|
+
return memo;
|
|
91
|
+
});
|
|
92
|
+
api.addExtraBabelPlugins(() => [require.resolve("@vue/babel-plugin-jsx")]);
|
|
93
|
+
api.addRuntimePluginKey(() => [
|
|
94
|
+
"router",
|
|
95
|
+
"onRouterCreated",
|
|
96
|
+
"onAppCreated",
|
|
97
|
+
"onMounted"
|
|
98
|
+
]);
|
|
99
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/features/tmpFiles/tmpFiles.ts
|
|
20
|
+
var tmpFiles_exports = {};
|
|
21
|
+
__export(tmpFiles_exports, {
|
|
22
|
+
default: () => tmpFiles_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(tmpFiles_exports);
|
|
25
|
+
var import_path = require("path");
|
|
26
|
+
var import_plugin_utils = require("umi/plugin-utils");
|
|
27
|
+
var import_constants = require("../../constants");
|
|
28
|
+
var tmpFiles_default = (api) => {
|
|
29
|
+
api.describe({
|
|
30
|
+
key: "preset-vue:tmpFiles"
|
|
31
|
+
});
|
|
32
|
+
api.onGenerateFiles(async () => {
|
|
33
|
+
const rendererPath = (0, import_plugin_utils.winPath)(
|
|
34
|
+
await api.applyPlugins({
|
|
35
|
+
key: "modifyRendererPath"
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
api.writeTmpFile({
|
|
39
|
+
noPluginDir: true,
|
|
40
|
+
path: "plugin-vue/index.ts",
|
|
41
|
+
tplPath: (0, import_path.join)(import_constants.TEMPLATES_DIR, "useAppData.tpl"),
|
|
42
|
+
context: {
|
|
43
|
+
rendererPath
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
api.register({
|
|
48
|
+
key: "onGenerateFiles",
|
|
49
|
+
fn: async () => {
|
|
50
|
+
const rendererPath = (0, import_plugin_utils.winPath)(
|
|
51
|
+
await api.applyPlugins({
|
|
52
|
+
key: "modifyRendererPath"
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
api.writeTmpFile({
|
|
56
|
+
noPluginDir: true,
|
|
57
|
+
path: "core/history.ts",
|
|
58
|
+
tplPath: (0, import_path.join)(import_constants.TEMPLATES_DIR, "history.tpl"),
|
|
59
|
+
context: {
|
|
60
|
+
rendererPath
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
api.writeTmpFile({
|
|
64
|
+
noPluginDir: true,
|
|
65
|
+
path: "core/EmptyRoute.tsx",
|
|
66
|
+
content: `
|
|
67
|
+
import { defineComponent, h, resolveComponent } from 'vue';
|
|
68
|
+
|
|
69
|
+
export default defineComponent({
|
|
70
|
+
name: 'EmptyRoute',
|
|
71
|
+
setup() {
|
|
72
|
+
const RouterView = resolveComponent('RouterView')
|
|
73
|
+
return () => h(RouterView, null);
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
`
|
|
77
|
+
});
|
|
78
|
+
api.writeTmpFile({
|
|
79
|
+
noPluginDir: true,
|
|
80
|
+
path: "core/App.vue",
|
|
81
|
+
content: `
|
|
82
|
+
<template>
|
|
83
|
+
<router-view></router-view>
|
|
84
|
+
</template>
|
|
85
|
+
`
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
stage: Infinity
|
|
89
|
+
});
|
|
90
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/features/vite/vite.ts
|
|
30
|
+
var vite_exports = {};
|
|
31
|
+
__export(vite_exports, {
|
|
32
|
+
default: () => vite_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(vite_exports);
|
|
35
|
+
var import_plugin_vue_jsx = __toESM(require("@vitejs/plugin-vue-jsx"));
|
|
36
|
+
var import_plugin_vue = __toESM(require("../../../compiled/@vitejs/plugin-vue"));
|
|
37
|
+
var vite_default = (api) => {
|
|
38
|
+
api.describe({
|
|
39
|
+
key: "preset-vue:vite"
|
|
40
|
+
});
|
|
41
|
+
api.modifyViteConfig((config) => {
|
|
42
|
+
var _a, _b, _c, _d;
|
|
43
|
+
(_a = config.plugins) == null ? void 0 : _a.push((0, import_plugin_vue.default)(api.config.vue));
|
|
44
|
+
(_d = config.plugins) == null ? void 0 : _d.push((0, import_plugin_vue_jsx.default)((_c = (_b = api.config) == null ? void 0 : _b.vue) == null ? void 0 : _c.pluginJsx));
|
|
45
|
+
return config;
|
|
46
|
+
});
|
|
47
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/features/vueBabelLoaderCustomize.ts
|
|
20
|
+
var vueBabelLoaderCustomize_exports = {};
|
|
21
|
+
__export(vueBabelLoaderCustomize_exports, {
|
|
22
|
+
default: () => vueBabelLoaderCustomize
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(vueBabelLoaderCustomize_exports);
|
|
25
|
+
var import_querystring = require("querystring");
|
|
26
|
+
function vueBabelLoaderCustomize() {
|
|
27
|
+
return {
|
|
28
|
+
config(config) {
|
|
29
|
+
const context = this;
|
|
30
|
+
if (config.options.filename) {
|
|
31
|
+
if (/\.vue$/.test(config.options.filename)) {
|
|
32
|
+
const query = (0, import_querystring.parse)(context.resourceQuery.slice(1));
|
|
33
|
+
if (query.type === "template") {
|
|
34
|
+
config.options.filename = `${config.options.filename}?type=${query.type}`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return config.options;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/features/webpack.ts
|
|
20
|
+
var webpack_exports = {};
|
|
21
|
+
__export(webpack_exports, {
|
|
22
|
+
default: () => webpack_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(webpack_exports);
|
|
25
|
+
var import_config = require("./config/config");
|
|
26
|
+
var webpack_default = (api) => {
|
|
27
|
+
api.describe({
|
|
28
|
+
key: "preset-vue:webpack"
|
|
29
|
+
});
|
|
30
|
+
api.chainWebpack((config) => {
|
|
31
|
+
(0, import_config.getConfig)(config, api);
|
|
32
|
+
return config;
|
|
33
|
+
});
|
|
34
|
+
api.modifyConfig((memo) => {
|
|
35
|
+
const enableMFSU = memo.mfsu !== false;
|
|
36
|
+
if (enableMFSU) {
|
|
37
|
+
memo.mfsu = {
|
|
38
|
+
...memo.mfsu || {},
|
|
39
|
+
chainWebpack(config) {
|
|
40
|
+
(0, import_config.getConfig)(config, api);
|
|
41
|
+
return config;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return memo;
|
|
46
|
+
});
|
|
47
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
default: () => src_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
|
35
|
+
var import_requireHook = require("./requireHook");
|
|
36
|
+
var src_default = (api) => {
|
|
37
|
+
api.describe({
|
|
38
|
+
key: "vue",
|
|
39
|
+
config: {
|
|
40
|
+
schema({ zod }) {
|
|
41
|
+
return zod.object({});
|
|
42
|
+
},
|
|
43
|
+
default: {}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
plugins: [
|
|
48
|
+
require.resolve("./features/default"),
|
|
49
|
+
require.resolve("./features/webpack"),
|
|
50
|
+
require.resolve("./features/tmpFiles/tmpFiles"),
|
|
51
|
+
require.resolve("./features/vite/vite")
|
|
52
|
+
]
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
|
|
25
|
+
mod2
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
|
|
28
|
+
|
|
29
|
+
// src/requireHook.ts
|
|
30
|
+
var requireHook_exports = {};
|
|
31
|
+
__export(requireHook_exports, {
|
|
32
|
+
hookPropertyMap: () => hookPropertyMap
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(requireHook_exports);
|
|
35
|
+
var import_deepImports = __toESM(require("@umijs/bundler-webpack/compiled/webpack/deepImports.json"));
|
|
36
|
+
var hookPropertyMap = /* @__PURE__ */ new Map([
|
|
37
|
+
["webpack", "@umijs/bundler-webpack/compiled/webpack"],
|
|
38
|
+
["webpack/package", "@umijs/bundler-webpack/compiled/webpack/package"],
|
|
39
|
+
["webpack/package.json", "@umijs/bundler-webpack/compiled/webpack/package"],
|
|
40
|
+
["webpack/lib/webpack", "@umijs/bundler-webpack/compiled/webpack"],
|
|
41
|
+
["webpack/lib/webpack.js", "@umijs/bundler-webpack/compiled/webpack"],
|
|
42
|
+
["tapable", "@umijs/bundler-utils/compiled/tapable"]
|
|
43
|
+
]);
|
|
44
|
+
import_deepImports.default.forEach((item) => {
|
|
45
|
+
const name = item.split("/").pop();
|
|
46
|
+
hookPropertyMap.set(item, `@umijs/bundler-webpack/compiled/webpack/${name}`);
|
|
47
|
+
hookPropertyMap.set(
|
|
48
|
+
`${item}.js`,
|
|
49
|
+
`@umijs/bundler-webpack/compiled/webpack/${name}`
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
var mod = require("module");
|
|
53
|
+
var resolveFilename = mod._resolveFilename;
|
|
54
|
+
mod._resolveFilename = function(request, parent, isMain, options) {
|
|
55
|
+
const hookResolved = hookPropertyMap.get(request);
|
|
56
|
+
if (hookResolved) {
|
|
57
|
+
request = hookResolved;
|
|
58
|
+
}
|
|
59
|
+
return resolveFilename.call(mod, request, parent, isMain, options);
|
|
60
|
+
};
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
hookPropertyMap
|
|
64
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/utils/resolveProjectDep.ts
|
|
30
|
+
var resolveProjectDep_exports = {};
|
|
31
|
+
__export(resolveProjectDep_exports, {
|
|
32
|
+
resolveProjectDep: () => resolveProjectDep,
|
|
33
|
+
resolveVuePath: () => resolveVuePath
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(resolveProjectDep_exports);
|
|
36
|
+
var import_path = require("path");
|
|
37
|
+
var import_plugin_utils = require("umi/plugin-utils");
|
|
38
|
+
function resolveProjectDep(opts) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
if (((_a = opts.pkg.dependencies) == null ? void 0 : _a[opts.dep]) || ((_b = opts.pkg.devDependencies) == null ? void 0 : _b[opts.dep])) {
|
|
41
|
+
return (0, import_path.dirname)(
|
|
42
|
+
import_plugin_utils.resolve.sync(`${opts.dep}/package.json`, {
|
|
43
|
+
basedir: opts.cwd
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function resolveVuePath(opts) {
|
|
49
|
+
const vuePkgPath = resolveProjectDep({
|
|
50
|
+
pkg: opts.pkg,
|
|
51
|
+
cwd: opts.cwd,
|
|
52
|
+
dep: "vue"
|
|
53
|
+
}) || (0, import_path.dirname)(require.resolve("vue/package.json"));
|
|
54
|
+
return (0, import_path.join)(vuePkgPath, opts.path);
|
|
55
|
+
}
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
resolveProjectDep,
|
|
59
|
+
resolveVuePath
|
|
60
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@umijs/preset-vue",
|
|
3
|
+
"version": "4.0.0-canary-20240513.3",
|
|
4
|
+
"description": "@umijs/preset-vue",
|
|
5
|
+
"homepage": "https://github.com/umijs/umi/tree/master/packages/preset-vue#readme",
|
|
6
|
+
"bugs": "https://github.com/umijs/umi/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/umijs/umi"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"templates",
|
|
17
|
+
"compiled"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@vitejs/plugin-vue-jsx": "3.0.1",
|
|
21
|
+
"@vue/babel-plugin-jsx": "1.1.1",
|
|
22
|
+
"vue": "3.2.45",
|
|
23
|
+
"vue-loader": "17.0.1",
|
|
24
|
+
"vue-router": "4.1.6",
|
|
25
|
+
"@umijs/renderer-vue": "4.0.0-canary-20240513.3"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@vitejs/plugin-vue": "4.1.0",
|
|
29
|
+
"umi": "4.0.0-canary-20240513.3"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"authors": [
|
|
35
|
+
"chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
|
|
36
|
+
],
|
|
37
|
+
"compiledConfig": {
|
|
38
|
+
"deps": [
|
|
39
|
+
"@vitejs/plugin-vue"
|
|
40
|
+
],
|
|
41
|
+
"externals": {
|
|
42
|
+
"vue": "vue",
|
|
43
|
+
"vue/compiler-sfc": "vue/compiler-sfc",
|
|
44
|
+
"vite": "@umijs/bundler-vite/compiled/vite",
|
|
45
|
+
"esbuild": "@umijs/bundler-utils/compiled/esbuild"
|
|
46
|
+
},
|
|
47
|
+
"excludeDtsDeps": [
|
|
48
|
+
"@vitejs/plugin-vue"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "umi-scripts father build",
|
|
53
|
+
"build:deps": "umi-scripts bundleDeps",
|
|
54
|
+
"dev": "umi-scripts father dev"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createWebHashHistory, createMemoryHistory, createWebHistory } from '{{{ rendererPath }}}';
|
|
2
|
+
import type { RouterHistory } from '{{{ rendererPath }}}';
|
|
3
|
+
|
|
4
|
+
let history: RouterHistory;
|
|
5
|
+
export function createHistory(opts: any) {
|
|
6
|
+
if (opts.type === 'hash') {
|
|
7
|
+
history = createWebHashHistory(opts.basename);
|
|
8
|
+
} else if (opts.type === 'memory') {
|
|
9
|
+
history = createMemoryHistory(opts.basename);
|
|
10
|
+
} else {
|
|
11
|
+
history = createWebHistory(opts.basename);
|
|
12
|
+
}
|
|
13
|
+
return history;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { history };
|