webpack-code-inspector-plugin
Advanced tools
Comparing version 0.4.0-beta.1 to 0.4.0
@@ -1,1 +0,1 @@ | ||
(function(s,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t(require("path")):typeof define=="function"&&define.amd?define(["path"],t):(s=typeof globalThis!="undefined"?globalThis:s||self,s.WebpackCodeInspectorPlugin=t(s.path))})(this,function(s){"use strict";let t=!0;const f=d=>(e,o)=>{var i;if(!t)return;t=!1;const u=(e==null?void 0:e.compiler)||e,n=(i=u==null?void 0:u.options)==null?void 0:i.module;((n==null?void 0:n.rules)||(n==null?void 0:n.loaders)||[]).push({test:/\.(vue|jsx|tsx|js|ts)$/,exclude:/node_modules/,use:[{loader:s.resolve(__dirname,"./loader.js"),options:d}]}),typeof o=="function"&&o()};class r{constructor(e){this.options=e||{}}apply(e){var o;t=!0,!this.options.close&&(((o=e==null?void 0:e.options)==null?void 0:o.mode)!=="development"&&process.env.NODE_ENV!=="development"||f(this.options)(e,()=>{}))}}return r}); | ||
(function(s,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e(require("path")):typeof define=="function"&&define.amd?define(["path"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,s.WebpackCodeInspectorPlugin=e(s.path))})(this,function(s){"use strict";var c=Object.defineProperty;var i=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var p=(s,e,t)=>e in s?c(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,a=(s,e)=>{for(var t in e||(e={}))l.call(e,t)&&p(s,t,e[t]);if(i)for(var t of i(e))j.call(e,t)&&p(s,t,e[t]);return s};let e=!0;const t=d=>(n,u)=>{var f;if(!e)return;e=!1;const r=(n==null?void 0:n.compiler)||n,o=(f=r==null?void 0:r.options)==null?void 0:f.module;((o==null?void 0:o.rules)||(o==null?void 0:o.loaders)||[]).push(a({test:/\.(vue|jsx|tsx|js|ts|mjs|mts)$/,exclude:/node_modules/,use:[{loader:s.resolve(__dirname,"./loader.js"),options:d}]},d.enforcePre===!1?{}:{enforce:"pre"})),typeof u=="function"&&u()};class h{constructor(n){this.options=n||{}}apply(n){var u;e=!0,!this.options.close&&(((u=n==null?void 0:n.options)==null?void 0:u.mode)!=="development"&&process.env.NODE_ENV!=="development"||t(this.options)(n,()=>{}))}}return h}); |
@@ -1,1 +0,1 @@ | ||
(function(s,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t(require("path")):typeof define=="function"&&define.amd?define(["path"],t):(s=typeof globalThis!="undefined"?globalThis:s||self,s.WebpackCodeInspectorPlugin=t(s.path))})(this,function(s){"use strict";let t=!0;const f=d=>(e,o)=>{var i;if(!t)return;t=!1;const u=(e==null?void 0:e.compiler)||e,n=(i=u==null?void 0:u.options)==null?void 0:i.module;((n==null?void 0:n.rules)||(n==null?void 0:n.loaders)||[]).push({test:/\.(vue|jsx|tsx|js|ts)$/,exclude:/node_modules/,use:[{loader:s.resolve(__dirname,"./loader.js"),options:d}]}),typeof o=="function"&&o()};class r{constructor(e){this.options=e||{}}apply(e){var o;t=!0,!this.options.close&&(((o=e==null?void 0:e.options)==null?void 0:o.mode)!=="development"&&process.env.NODE_ENV!=="development"||f(this.options)(e,()=>{}))}}return r}); | ||
(function(s,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e(require("path")):typeof define=="function"&&define.amd?define(["path"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,s.WebpackCodeInspectorPlugin=e(s.path))})(this,function(s){"use strict";var c=Object.defineProperty;var i=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var p=(s,e,t)=>e in s?c(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,a=(s,e)=>{for(var t in e||(e={}))l.call(e,t)&&p(s,t,e[t]);if(i)for(var t of i(e))j.call(e,t)&&p(s,t,e[t]);return s};let e=!0;const t=d=>(n,u)=>{var f;if(!e)return;e=!1;const r=(n==null?void 0:n.compiler)||n,o=(f=r==null?void 0:r.options)==null?void 0:f.module;((o==null?void 0:o.rules)||(o==null?void 0:o.loaders)||[]).push(a({test:/\.(vue|jsx|tsx|js|ts|mjs|mts)$/,exclude:/node_modules/,use:[{loader:s.resolve(__dirname,"./loader.js"),options:d}]},d.enforcePre===!1?{}:{enforce:"pre"})),typeof u=="function"&&u()};class h{constructor(n){this.options=n||{}}apply(n){var u;e=!0,!this.options.close&&(((u=n==null?void 0:n.options)==null?void 0:u.mode)!=="development"&&process.env.NODE_ENV!=="development"||t(this.options)(n,()=>{}))}}return h}); |
@@ -1,1 +0,1 @@ | ||
"use strict";var m=(e,t,r)=>new Promise((p,c)=>{var i=s=>{try{n(r.next(s))}catch(h){c(h)}},l=s=>{try{n(r.throw(s))}catch(h){c(h)}},n=s=>s.done?p(s.value):Promise.resolve(s.value).then(i,l);n((r=r.apply(e,t)).next())});const o=require("code-inspector-core"),C=require("path");function S(e){return m(this,null,function*(){var x,d,f,g;this.cacheable&&this.cacheable();const t=o.normalizePath(this.resourcePath),r=this.query,p=o.normalizePath((d=(x=this.rootContext)!=null?x:this.options.context)!=null?d:""),c=o.normalizePath(C.relative(p,t));let i=new URLSearchParams(this.resource);e=yield o.getServedCode(r,p,t,e);const l=[".js",".ts",".jsx",".tsx"],n=["isJsx","isTsx","lang.jsx","lang.tsx"],s=l.some(a=>t.endsWith(a))||t.endsWith(".vue")&&n.some(a=>i.get(a)!==null),h=t.endsWith(".vue")&&(i.get("lang")==="tsx"||i.get("lang")==="jsx"),P=t.endsWith(".vue")&&i.get("type")!=="style"&&i.get("type")!=="script"&&i.get("raw")===null;if(s)e=o.enhanceCode({code:e,filePath:c,fileType:"jsx"});else if(h){const{descriptor:a}=o.parseSFC(e,{sourceMap:!1}),j=[(f=a.script)==null?void 0:f.content,(g=a.scriptSetup)==null?void 0:g.content];for(const u of j){if(!u)continue;const y=o.enhanceCode({code:u,filePath:c,fileType:"jsx"});e=e.replace(u,y)}}else P&&(e=o.enhanceCode({code:e,filePath:c,fileType:"vue"}));return e})}module.exports=S; | ||
"use strict";var m=(e,t,r)=>new Promise((p,c)=>{var i=s=>{try{n(r.next(s))}catch(h){c(h)}},l=s=>{try{n(r.throw(s))}catch(h){c(h)}},n=s=>s.done?p(s.value):Promise.resolve(s.value).then(i,l);n((r=r.apply(e,t)).next())});const o=require("code-inspector-core"),C=require("path");function S(e){return m(this,null,function*(){var x,d,f,g;this.cacheable&&this.cacheable();const t=o.normalizePath(this.resourcePath),r=this.query,p=o.normalizePath((d=(x=this.rootContext)!=null?x:this.options.context)!=null?d:""),c=o.normalizePath(C.relative(p,t));let i=new URLSearchParams(this.resource);e=yield o.getServedCode(r,p,t,e);const l=[".js",".ts",".mjs",".mts",".jsx",".tsx"],n=["isJsx","isTsx","lang.jsx","lang.tsx"],s=l.some(a=>t.endsWith(a))||t.endsWith(".vue")&&n.some(a=>i.get(a)!==null),h=t.endsWith(".vue")&&(i.get("lang")==="tsx"||i.get("lang")==="jsx"),j=t.endsWith(".vue")&&i.get("type")!=="style"&&i.get("type")!=="script"&&i.get("raw")===null;if(s)e=o.enhanceCode({code:e,filePath:c,fileType:"jsx"});else if(h){const{descriptor:a}=o.parseSFC(e,{sourceMap:!1}),P=[(f=a.script)==null?void 0:f.content,(g=a.scriptSetup)==null?void 0:g.content];for(const u of P){if(!u)continue;const y=o.enhanceCode({code:u,filePath:c,fileType:"jsx"});e=e.replace(u,y)}}else j&&(e=o.enhanceCode({code:e,filePath:c,fileType:"vue"}));return e})}module.exports=S; |
{ | ||
"name": "webpack-code-inspector-plugin", | ||
"version": "0.4.0-beta.1", | ||
"version": "0.4.0", | ||
"main": "./dist/index.umd.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. |
Sorry, the diff of this file is not supported yet
10924
74
64
+ Addedcode-inspector-core@0.4.0(transitive)
- Removedcode-inspector-core@0.4.0-beta.1(transitive)
Updatedcode-inspector-core@0.4.0