@code-inspector/webpack 1.4.0 → 1.4.2
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/dist/loader.js +1 -1
- package/package.json +2 -2
package/dist/loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var T=(s,e,t)=>new Promise((p,a)=>{var o=i=>{try{c(t.next(i))}catch(n){a(n)}},u=i=>{try{c(t.throw(i))}catch(n){a(n)}},c=i=>i.done?p(i.value):Promise.resolve(i.value).then(o,u);c((t=t.apply(s,e)).next())});const r=require("@code-inspector/core"),x=["isJsx","isTsx","lang.jsx","lang.tsx"];function S(s){return T(this,null,function*(){var f,y,g;this.cacheable&&this.cacheable(!0);let e=r.normalizePath(this.resourcePath),t=new URLSearchParams(((f=this.resource.split("?"))==null?void 0:f[1])||"");const p=this.query;let{escapeTags:a=[],mappings:o}=p||{};if(r.isExcludedFile(e,p))return s;if(e=r.getMappingFilePath(e,o),r.isJsTypeFile(e)||e.endsWith(".vue")&&x.some(l=>t.get(l)!==null))return r.transformCode({content:s,filePath:e,fileType:"jsx",escapeTags:a,pathType:p.pathType});if(e.endsWith(".vue")&&(t.get("lang")==="tsx"||t.get("lang")==="jsx")){const{descriptor:l}=r.parseSFC(s,{sourceMap:!1}),d=[(y=l.script)==null?void 0:y.content,(g=l.scriptSetup)==null?void 0:g.content];for(const h of d){if(!h)continue;const m=r.transformCode({content:h,filePath:e,fileType:"jsx",escapeTags:a,pathType:p.pathType});s=s.replace(h,m)}return s}const i=e.endsWith(".vue")&&t.get("type")!=="style"&&t.get("type")!=="script"&&t.get("raw")===null,n=e.endsWith(".html")&&t.get("type")==="template"&&t.has("vue");return i||n?r.transformCode({content:s,filePath:e,fileType:"vue",escapeTags:a,pathType:p.pathType}):e.endsWith(".svelte")?r.transformCode({content:s,filePath:e,fileType:"svelte",escapeTags:a,pathType:p.pathType}):s})}module.exports=S;
|
|
1
|
+
"use strict";var T=(s,e,t)=>new Promise((p,a)=>{var o=i=>{try{c(t.next(i))}catch(n){a(n)}},u=i=>{try{c(t.throw(i))}catch(n){a(n)}},c=i=>i.done?p(i.value):Promise.resolve(i.value).then(o,u);c((t=t.apply(s,e)).next())});const r=require("@code-inspector/core"),x=["isJsx","isTsx","lang.jsx","lang.tsx"];function S(s){return T(this,null,function*(){var f,y,g;this.cacheable&&this.cacheable(!0);let e=r.normalizePath(this.resourcePath),t=new URLSearchParams(((f=this.resource.split("?"))==null?void 0:f[1])||"");const p=this.query;let{escapeTags:a=[],mappings:o}=p||{};if(r.isExcludedFile(e,p))return s;if(e=r.getMappingFilePath(e,o),r.isJsTypeFile(e)||e.endsWith(".vue")&&x.some(l=>t.get(l)!==null))return r.transformCode({content:s,filePath:e,fileType:"jsx",escapeTags:a,pathType:p.pathType});if(e.endsWith(".vue")&&(t.get("lang")==="tsx"||t.get("lang")==="jsx")){const{descriptor:l}=r.parseSFC(s,{sourceMap:!1}),d=[(y=l.script)==null?void 0:y.content,(g=l.scriptSetup)==null?void 0:g.content];for(const h of d){if(!h)continue;const m=r.transformCode({content:h,filePath:e,fileType:"jsx",escapeTags:a,pathType:p.pathType});s=s.replace(h,()=>m)}return s}const i=e.endsWith(".vue")&&t.get("type")!=="style"&&t.get("type")!=="script"&&t.get("raw")===null,n=e.endsWith(".html")&&t.get("type")==="template"&&t.has("vue");return i||n?r.transformCode({content:s,filePath:e,fileType:"vue",escapeTags:a,pathType:p.pathType}):e.endsWith(".svelte")?r.transformCode({content:s,filePath:e,fileType:"svelte",escapeTags:a,pathType:p.pathType}):s})}module.exports=S;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-inspector/webpack",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"main": "./dist/index.umd.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"typings": "./types/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"url": "https://github.com/zh-lx/code-inspector/issues"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@code-inspector/core": "1.4.
|
|
43
|
+
"@code-inspector/core": "1.4.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^20.3.3",
|