code-inspector-plugin
Advanced tools
Comparing version 0.19.0 to 0.19.1
@@ -1,1 +0,1 @@ | ||
"use strict";var b=Object.defineProperty,T=Object.defineProperties;var S=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var g=(e,t,n)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))_.call(t,n)&&g(e,n,t[n]);if(h)for(var n of h(t))q.call(t,n)&&g(e,n,t[n]);return e},v=(e,t)=>T(e,S(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("vite-code-inspector-plugin"),w=require("webpack-code-inspector-plugin"),i=require("code-inspector-core"),f=require("fs"),p=require("path"),F=require("chalk"),j=require("dotenv");var R=(e,t,n)=>new Promise((l,u)=>{var a=o=>{try{c(n.next(o))}catch(s){u(s)}},r=o=>{try{c(n.throw(o))}catch(s){u(s)}},c=o=>o.done?l(o.value):Promise.resolve(o.value).then(a,r);c((n=n.apply(e,t)).next())});const W="esbuild-code-inspector-plugin";function D(e){return{name:W,setup(t){if(e.close||!i.isDev(e.dev,!1))return;const n={port:0,entry:"",output:e.output},{escapeTags:l=[]}=e,u=new Map;t.onLoad({filter:e.match||/\.(jsx|tsx|js|ts|mjs|mts)?$/},a=>R(this,null,function*(){let r=a.path;r=i.getMappingFilePath(r,e.mappings);let c=yield f.promises.readFile(r,"utf8"),o=u.get(r);if(!o||o.originCode!==c){let s=c;if(r.match("node_modules")){if(!i.matchCondition(e.include||[],r))return s}else s=yield i.getCodeWithWebComponent({options:e,file:r,code:s,record:n});let d="";if(i.isJsTypeFile(r)?d="jsx":r.endsWith(".svelte")&&(d="svelte"),d)s=i.transformCode({content:s,filePath:r,fileType:d,escapeTags:l});else if(r.endsWith(".vue")){d="vue";const{descriptor:m}=i.parseSFC(s,{sourceMap:!1}),I=i.transformCode({content:m.template.content,filePath:r,fileType:d,escapeTags:l});s=s.replace(m.template.content,I)}const y=p.extname(r).replace(".","");o={originCode:c,output:{contents:s,loader:y}},u.set(r,o)}return o.output}))}}}function P(e){if(!(e!=null&&e.bundler)){console.log(F.red("Please specify the bundler in the options of code-inspector-plugin."));return}let t=!1;if(e.needEnvInspector)if(t=!0,process.env.CODE_INSPECTOR==="true")t=!1;else{const a=p.resolve(process.cwd(),".env.local");if(f.existsSync(a)){const r=f.readFileSync(a,"utf-8"),c=j.parse(r||"");(c==null?void 0:c.CODE_INSPECTOR)==="true"&&(t=!1)}}let n="";typeof __dirname!="undefined"?n=__dirname:n=p.dirname(i.fileURLToPath(typeof document=="undefined"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("index.js",document.baseURI).href));const l=v(C({},e),{close:t,output:p.resolve(n,"./")});return e.bundler==="webpack"||e.bundler==="rspack"?new w(l):e.bundler==="esbuild"?D(l):x.ViteCodeInspectorPlugin(l)}const E=P;exports.CodeInspectorPlugin=P;exports.codeInspectorPlugin=E; | ||
"use strict";var b=Object.defineProperty,T=Object.defineProperties;var S=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var g=(e,t,n)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))_.call(t,n)&&g(e,n,t[n]);if(h)for(var n of h(t))q.call(t,n)&&g(e,n,t[n]);return e},v=(e,t)=>T(e,S(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("vite-code-inspector-plugin"),w=require("webpack-code-inspector-plugin"),i=require("code-inspector-core"),f=require("fs"),p=require("path"),F=require("chalk"),j=require("dotenv");var R=(e,t,n)=>new Promise((l,u)=>{var a=o=>{try{s(n.next(o))}catch(c){u(c)}},r=o=>{try{s(n.throw(o))}catch(c){u(c)}},s=o=>o.done?l(o.value):Promise.resolve(o.value).then(a,r);s((n=n.apply(e,t)).next())});const W="esbuild-code-inspector-plugin";function D(e){return{name:W,setup(t){if(e.close||!i.isDev(e.dev,!1))return;const n={port:0,entry:"",output:e.output},{escapeTags:l=[]}=e,u=new Map;t.onLoad({filter:e.match||/\.(jsx|tsx|js|ts|mjs|mts)?$/},a=>R(this,null,function*(){let r=a.path;r=i.getMappingFilePath(r,e.mappings);let s=yield f.promises.readFile(r,"utf8"),o=u.get(r);if(!o||o.originCode!==s){let c=s;if(r.match("node_modules")||i.matchCondition(e.include||[],r)){if(!i.matchCondition(e.include||[],r))return c}else c=yield i.getCodeWithWebComponent({options:e,file:r,code:c,record:n});let d="";if(i.isJsTypeFile(r)?d="jsx":r.endsWith(".svelte")&&(d="svelte"),d)c=i.transformCode({content:c,filePath:r,fileType:d,escapeTags:l});else if(r.endsWith(".vue")){d="vue";const{descriptor:m}=i.parseSFC(c,{sourceMap:!1}),I=i.transformCode({content:m.template.content,filePath:r,fileType:d,escapeTags:l});c=c.replace(m.template.content,I)}const y=p.extname(r).replace(".","");o={originCode:s,output:{contents:c,loader:y}},u.set(r,o)}return o.output}))}}}function P(e){if(!(e!=null&&e.bundler)){console.log(F.red("Please specify the bundler in the options of code-inspector-plugin."));return}let t=!1;if(e.needEnvInspector)if(t=!0,process.env.CODE_INSPECTOR==="true")t=!1;else{const a=p.resolve(process.cwd(),".env.local");if(f.existsSync(a)){const r=f.readFileSync(a,"utf-8"),s=j.parse(r||"");(s==null?void 0:s.CODE_INSPECTOR)==="true"&&(t=!1)}}let n="";typeof __dirname!="undefined"?n=__dirname:n=p.dirname(i.fileURLToPath(typeof document=="undefined"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("index.js",document.baseURI).href));const l=v(C({},e),{close:t,output:p.resolve(n,"./")});return e.bundler==="webpack"||e.bundler==="rspack"?new w(l):e.bundler==="esbuild"?D(l):x.ViteCodeInspectorPlugin(l)}const E=P;exports.CodeInspectorPlugin=P;exports.codeInspectorPlugin=E; |
{ | ||
"name": "code-inspector-plugin", | ||
"version": "0.19.0", | ||
"version": "0.19.1", | ||
"main": "./dist/index.js", | ||
@@ -51,6 +51,6 @@ "module": "./dist/index.mjs", | ||
"dotenv": "^16.3.1", | ||
"code-inspector-core": "0.19.0", | ||
"vite-code-inspector-plugin": "0.19.0", | ||
"webpack-code-inspector-plugin": "0.19.0", | ||
"esbuild-code-inspector-plugin": "0.19.0" | ||
"code-inspector-core": "0.19.1", | ||
"vite-code-inspector-plugin": "0.19.1", | ||
"webpack-code-inspector-plugin": "0.19.1", | ||
"esbuild-code-inspector-plugin": "0.19.1" | ||
}, | ||
@@ -57,0 +57,0 @@ "devDependencies": { |
@@ -70,3 +70,3 @@ <div align="center"> | ||
Please check here for more usage information: [code-inspector-plugin configuration](https://en.inspector.fe-dev.cn/guide/start.html#configuration) | ||
Please check here for more usage information: [code-inspector-plugin configuration](https://inspector.fe-dev.cn/en/guide/start.html#configuration) | ||
@@ -73,0 +73,0 @@ - 1.Configuring Build Tools |
Sorry, the diff of this file is not supported yet
20050
+ Addedcode-inspector-core@0.19.1(transitive)
+ Addedesbuild-code-inspector-plugin@0.19.1(transitive)
+ Addedvite-code-inspector-plugin@0.19.1(transitive)
+ Addedwebpack-code-inspector-plugin@0.19.1(transitive)
- Removedcode-inspector-core@0.19.0(transitive)
- Removedesbuild-code-inspector-plugin@0.19.0(transitive)
- Removedvite-code-inspector-plugin@0.19.0(transitive)
- Removedwebpack-code-inspector-plugin@0.19.0(transitive)
Updatedcode-inspector-core@0.19.1