vite-code-inspector-plugin
Advanced tools
Comparing version 0.4.0-beta.1 to 0.4.0
@@ -1,1 +0,1 @@ | ||
"use strict";var h=(a,f,e)=>new Promise((s,i)=>{var r=t=>{try{l(e.next(t))}catch(o){i(o)}},n=t=>{try{l(e.throw(t))}catch(o){i(o)}},l=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,n);l((e=e.apply(a,f)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("code-inspector-core"),x=require("path"),P="vite-code-inspector-plugin";let u="";function v(a){return{name:P,enforce:"pre",apply(e,{command:s}){return a!=null&&a.close?!1:s==="serve"},transform(e,s){return h(this,null,function*(){if(u||(u=process.cwd()),e=yield c.getServedCode(a,u,s,e),s.match("node_modules"))return e;const[i]=s.split("?",2),r=c.normalizePath(i),n=new URLSearchParams(s),l=[".js",".ts",".jsx",".tsx"],t=["isJsx","isTsx","lang.jsx","lang.tsx"],o=l.some(g=>r.endsWith(g))||r.endsWith(".vue")&&(t.some(g=>n.get(g)!==null)||n.get("lang")==="tsx"||n.get("lang")==="jsx"),p=r.endsWith(".vue")&&n.get("type")!=="style"&&n.get("raw")===null,m=c.normalizePath(x.relative(u,r));return o?e=yield c.enhanceCode({code:e,filePath:m,fileType:"jsx"}):p&&(e=yield c.enhanceCode({code:e,filePath:m,fileType:"vue"})),e})}}}exports.ViteCodeInspectorPlugin=v; | ||
"use strict";var y=Object.defineProperty,d=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var x=(t,s,e)=>s in t?y(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e,P=(t,s)=>{for(var e in s||(s={}))C.call(s,e)&&x(t,e,s[e]);if(h)for(var e of h(s))S.call(s,e)&&x(t,e,s[e]);return t},p=(t,s)=>d(t,w(s));var v=(t,s,e)=>new Promise((r,i)=>{var l=n=>{try{c(e.next(n))}catch(o){i(o)}},a=n=>{try{c(e.throw(n))}catch(o){i(o)}},c=n=>n.done?r(n.value):Promise.resolve(n.value).then(l,a);c((e=e.apply(t,s)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("code-inspector-core"),T=require("path"),I="vite-code-inspector-plugin";let m="";function L(t){return p(P({name:I},t.enforcePre===!1?{}:{enforce:"pre"}),{apply(e,{command:r}){return t!=null&&t.close?!1:r==="serve"},transform(e,r){return v(this,null,function*(){if(m||(m=process.cwd()),e=yield u.getServedCode(t,m,r,e),r.match("node_modules"))return e;const[i]=r.split("?",2),l=u.normalizePath(i),a=new URLSearchParams(r),c=[".js",".ts",".mjs",".mts",".jsx",".tsx"],n=["isJsx","isTsx","lang.jsx","lang.tsx"],o=c.some(g=>l.endsWith(g))||l.endsWith(".vue")&&(n.some(g=>a.get(g)!==null)||a.get("lang")==="tsx"||a.get("lang")==="jsx"),j=l.endsWith(".vue")&&a.get("type")!=="style"&&a.get("raw")===null,f=u.normalizePath(T.relative(m,l));return o?e=yield u.enhanceCode({code:e,filePath:f,fileType:"jsx"}):j&&(e=yield u.enhanceCode({code:e,filePath:f,fileType:"vue"})),e})}})}exports.ViteCodeInspectorPlugin=L; |
@@ -1,1 +0,1 @@ | ||
"use strict";var h=(a,f,e)=>new Promise((s,i)=>{var r=t=>{try{l(e.next(t))}catch(o){i(o)}},n=t=>{try{l(e.throw(t))}catch(o){i(o)}},l=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,n);l((e=e.apply(a,f)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("code-inspector-core"),x=require("path"),P="vite-code-inspector-plugin";let u="";function v(a){return{name:P,enforce:"pre",apply(e,{command:s}){return a!=null&&a.close?!1:s==="serve"},transform(e,s){return h(this,null,function*(){if(u||(u=process.cwd()),e=yield c.getServedCode(a,u,s,e),s.match("node_modules"))return e;const[i]=s.split("?",2),r=c.normalizePath(i),n=new URLSearchParams(s),l=[".js",".ts",".jsx",".tsx"],t=["isJsx","isTsx","lang.jsx","lang.tsx"],o=l.some(g=>r.endsWith(g))||r.endsWith(".vue")&&(t.some(g=>n.get(g)!==null)||n.get("lang")==="tsx"||n.get("lang")==="jsx"),p=r.endsWith(".vue")&&n.get("type")!=="style"&&n.get("raw")===null,m=c.normalizePath(x.relative(u,r));return o?e=yield c.enhanceCode({code:e,filePath:m,fileType:"jsx"}):p&&(e=yield c.enhanceCode({code:e,filePath:m,fileType:"vue"})),e})}}}exports.ViteCodeInspectorPlugin=v; | ||
"use strict";var y=Object.defineProperty,d=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var x=(t,s,e)=>s in t?y(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e,P=(t,s)=>{for(var e in s||(s={}))C.call(s,e)&&x(t,e,s[e]);if(h)for(var e of h(s))S.call(s,e)&&x(t,e,s[e]);return t},p=(t,s)=>d(t,w(s));var v=(t,s,e)=>new Promise((r,i)=>{var l=n=>{try{c(e.next(n))}catch(o){i(o)}},a=n=>{try{c(e.throw(n))}catch(o){i(o)}},c=n=>n.done?r(n.value):Promise.resolve(n.value).then(l,a);c((e=e.apply(t,s)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("code-inspector-core"),T=require("path"),I="vite-code-inspector-plugin";let m="";function L(t){return p(P({name:I},t.enforcePre===!1?{}:{enforce:"pre"}),{apply(e,{command:r}){return t!=null&&t.close?!1:r==="serve"},transform(e,r){return v(this,null,function*(){if(m||(m=process.cwd()),e=yield u.getServedCode(t,m,r,e),r.match("node_modules"))return e;const[i]=r.split("?",2),l=u.normalizePath(i),a=new URLSearchParams(r),c=[".js",".ts",".mjs",".mts",".jsx",".tsx"],n=["isJsx","isTsx","lang.jsx","lang.tsx"],o=c.some(g=>l.endsWith(g))||l.endsWith(".vue")&&(n.some(g=>a.get(g)!==null)||a.get("lang")==="tsx"||a.get("lang")==="jsx"),j=l.endsWith(".vue")&&a.get("type")!=="style"&&a.get("raw")===null,f=u.normalizePath(T.relative(m,l));return o?e=yield u.enhanceCode({code:e,filePath:f,fileType:"jsx"}):j&&(e=yield u.enhanceCode({code:e,filePath:f,fileType:"vue"})),e})}})}exports.ViteCodeInspectorPlugin=L; |
{ | ||
"name": "vite-code-inspector-plugin", | ||
"version": "0.4.0-beta.1", | ||
"version": "0.4.0", | ||
"main": "./dist/index.js", | ||
@@ -41,3 +41,3 @@ "module": "./dist/index.mjs", | ||
"dependencies": { | ||
"code-inspector-core": "0.4.0-beta.1" | ||
"code-inspector-core": "0.4.0" | ||
}, | ||
@@ -44,0 +44,0 @@ "devDependencies": { |
@@ -49,3 +49,3 @@ <div align="center"> | ||
- The following bundlers are currently supported:<br /> | ||
✅ webpack(3.x/4.x/5.x)<br /> | ||
✅ webpack<br /> | ||
✅ vite<br /> | ||
@@ -64,2 +64,2 @@ ✅ rspack | ||
For any usage issues, please leave a message below my [Twitter](https://twitter.com/zhulxing312147) post or [submit an issue](https://github.com/zh-lx/code-inspector/issues) on Github. | ||
For any usage issues, please leave a message below my [Twitter](https://twitter.com/zhulxing312147) post or [submit an issue](https://github.com/zh-lx/code-inspector/issues) on Github. |
@@ -6,4 +6,2 @@ import { CodeOptions } from 'code-inspector-core'; | ||
export declare function ViteCodeInspectorPlugin(options?: Options): { | ||
name: string; | ||
enforce: "pre"; | ||
apply(_: any, { command }: { | ||
@@ -13,3 +11,5 @@ command: any; | ||
transform(code: any, id: any): Promise<any>; | ||
enforce?: "pre"; | ||
name: string; | ||
}; | ||
export {}; |
Sorry, the diff of this file is not supported yet
10812
88
64
+ Addedcode-inspector-core@0.4.0(transitive)
- Removedcode-inspector-core@0.4.0-beta.1(transitive)
Updatedcode-inspector-core@0.4.0