Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@code-inspector/webpack

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code-inspector/webpack - npm Package Compare versions

Comparing version
1.3.0
to
1.3.1
+89
-88
dist/index.mjs
var L = Object.defineProperty, N = Object.defineProperties;
var O = Object.getOwnPropertyDescriptors;
var $ = Object.getOwnPropertySymbols;
var C = Object.getOwnPropertySymbols;
var S = Object.prototype.hasOwnProperty, z = Object.prototype.propertyIsEnumerable;
var w = (e, t, s) => t in e ? L(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, h = (e, t) => {
for (var s in t || (t = {}))
S.call(t, s) && w(e, s, t[s]);
if ($)
for (var s of $(t))
z.call(t, s) && w(e, s, t[s]);
return e;
}, v = (e, t) => N(e, O(t));
var d = (e, t, s) => new Promise((n, r) => {
var a = (o) => {
var W = (s, t, e) => t in s ? L(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, d = (s, t) => {
for (var e in t || (t = {}))
S.call(t, e) && W(s, e, t[e]);
if (C)
for (var e of C(t))
z.call(t, e) && W(s, e, t[e]);
return s;
}, v = (s, t) => N(s, O(t));
var c = (s, t, e) => new Promise((n, a) => {
var r = (o) => {
try {
u(s.next(o));
i(e.next(o));
} catch (f) {
r(f);
a(f);
}
}, i = (o) => {
}, u = (o) => {
try {
u(s.throw(o));
i(e.throw(o));
} catch (f) {
r(f);
a(f);
}
}, u = (o) => o.done ? n(o.value) : Promise.resolve(o.value).then(a, i);
u((s = s.apply(e, t)).next());
}, i = (o) => o.done ? n(o.value) : Promise.resolve(o.value).then(r, u);
i((e = e.apply(s, t)).next());
});
import { normalizePath as D, fileURLToPath as I, isDev as F, isNextjsProject as H, getCodeWithWebComponent as Q } from "@code-inspector/core";
import p, { dirname as R } from "path";
function U(e, t) {
return d(this, null, function* () {
if (!e || !t)
import { normalizePath as _, fileURLToPath as I, isDev as R, getProjectRecord as F, isNextjsProject as H, getCodeWithWebComponent as Q } from "@code-inspector/core";
import j, { dirname as U } from "path";
function V(s, t) {
return c(this, null, function* () {
if (!s || !t)
return [];
const s = typeof e == "function" ? yield e() : e;
const e = typeof s == "function" ? yield s() : s;
let n = [];
if (typeof s == "object" && !Array.isArray(s))
for (const r in s) {
const a = s[r], i = a.import || a;
W(n, i, t);
if (typeof e == "object" && !Array.isArray(e))
for (const a in e) {
const r = e[a], u = r.import || r;
$(n, u, t);
}
else
W(n, s, t);
return n.filter((r) => !!r);
$(n, e, t);
return n.filter((a) => !!a);
});
}
function W(e, t, s) {
typeof t == "string" ? e.push(_(t, s)) : Array.isArray(t) && e.push(
...t.map((n) => _(n, s))
function $(s, t, e) {
typeof t == "string" ? s.push(w(t, e)) : Array.isArray(t) && s.push(
...t.map((n) => w(n, e))
);
}
function _(e, t) {
return p.isAbsolute(e) ? D(e) : e.startsWith(".") ? p.resolve(t, D(e)) : "";
function w(s, t) {
return j.isAbsolute(s) ? _(s) : s.startsWith(".") ? j.resolve(t, _(s)) : "";
}
let y = "";
typeof __dirname != "undefined" ? y = __dirname : y = R(I(import.meta.url));
let b = !0;
const V = (e, t) => {
var a, i;
if (!b)
let p = "";
typeof __dirname != "undefined" ? p = __dirname : p = U(I(import.meta.url));
let P = !0;
const q = (s, t) => {
var r, u;
if (!P)
return;
b = !1;
const s = (t == null ? void 0 : t.compiler) || t, n = (a = s == null ? void 0 : s.options) == null ? void 0 : a.module;
P = !1;
const e = (t == null ? void 0 : t.compiler) || t, n = (r = e == null ? void 0 : e.options) == null ? void 0 : r.module;
((n == null ? void 0 : n.rules) || (n == null ? void 0 : n.loaders) || []).push(
h({
test: (i = e.match) != null ? i : /\.html$/,
d({
test: (u = s.match) != null ? u : /\.html$/,
resourceQuery: /vue/,
use: [
{
loader: p.resolve(y, "./loader.js"),
options: e
loader: j.resolve(p, "./loader.js"),
options: s
}
]
}, e.enforcePre === !1 ? {} : { enforce: "pre" }),
h({
}, s.enforcePre === !1 ? {} : { enforce: "pre" }),
d({
test: /\.(vue|jsx|tsx|js|ts|mjs|mts|svelte)$/,
use: [
{
loader: p.resolve(y, "./loader.js"),
options: e
loader: j.resolve(p, "./loader.js"),
options: s
}
]
}, e.enforcePre === !1 ? {} : { enforce: "pre" }),
v(h({}, e.injectTo ? { resource: e.injectTo } : {
}, s.enforcePre === !1 ? {} : { enforce: "pre" }),
v(d({}, s.injectTo ? { resource: s.injectTo } : {
test: /\.(jsx|tsx|js|ts|mjs|mts)$/,

@@ -90,4 +90,4 @@ exclude: /node_modules/

{
loader: p.resolve(y, "./inject-loader.js"),
options: e
loader: j.resolve(p, "./inject-loader.js"),
options: s
}

@@ -99,31 +99,32 @@ ],

};
function k(e, t) {
function D(s, t, e) {
return Q({
options: v(h({}, e), { importClient: "code" }),
options: v(d({}, s), { importClient: "code" }),
file: "main.js",
code: "",
record: t,
inject: !0
inject: !0,
server: e
});
}
function q(n) {
return d(this, arguments, function* ({
options: e,
function B(n) {
return c(this, arguments, function* ({
options: s,
record: t,
assets: s
assets: e
}) {
const r = Object.keys(s).filter((a) => /\.html$/.test(a));
if (r.length) {
const a = yield k(e, t);
r.forEach((i) => {
const a = Object.keys(e).filter((r) => /\.html$/.test(r));
if (a.length) {
const r = yield D(s, t);
a.forEach((u) => {
var o, f;
const u = (f = (o = s[i]) == null ? void 0 : o.source) == null ? void 0 : f.call(o);
if (typeof u == "string") {
const c = u.replace(
const i = (f = (o = e[u]) == null ? void 0 : o.source) == null ? void 0 : f.call(o);
if (typeof i == "string") {
const h = i.replace(
"<head>",
'<head><script type="module">\n'.concat(a, "\n<\/script>")
'<head><script type="module">\n'.concat(r, "\n<\/script>")
);
s[i] = {
source: () => c,
size: () => c.length
e[u] = {
source: () => h,
size: () => h.length
};

@@ -135,3 +136,3 @@ }

}
class K {
class M {
constructor(t) {

@@ -141,29 +142,29 @@ this.options = t;

apply(t) {
return d(this, null, function* () {
var n, r, a, i, u, o, f, c, x, A, P, j, C;
if (b = !0, this.options.close || !F(
return c(this, null, function* () {
var a, r, u, i, o, f, h, b, k, A, y, x;
if (P = !0, this.options.close || !R(
this.options.dev,
((n = t == null ? void 0 : t.options) == null ? void 0 : n.mode) === "development" || process.env.NODE_ENV === "development"
((a = t == null ? void 0 : t.options) == null ? void 0 : a.mode) === "development" || process.env.NODE_ENV === "development"
))
return;
const s = {
const e = {
port: 0,
entry: "",
output: this.options.output,
inputs: U(
inputs: V(
(r = t == null ? void 0 : t.options) == null ? void 0 : r.entry,
(a = t == null ? void 0 : t.options) == null ? void 0 : a.context
(u = t == null ? void 0 : t.options) == null ? void 0 : u.context
),
envDir: (i = t == null ? void 0 : t.options) == null ? void 0 : i.context,
root: (u = t == null ? void 0 : t.options) == null ? void 0 : u.context
};
if (((f = (o = t == null ? void 0 : t.options) == null ? void 0 : o.cache) == null ? void 0 : f.type) === "filesystem" && (this.options.cache ? k(this.options, s) : t.options.cache.version = "code-inspector-".concat(Date.now())), ((A = (x = (c = t == null ? void 0 : t.options) == null ? void 0 : c.experiments) == null ? void 0 : x.cache) == null ? void 0 : A.type) === "persistent" && (this.options.cache ? k(this.options, s) : t.options.experiments.cache.version = "code-inspector-".concat(Date.now())), V(v(h({}, this.options), { record: s }), t), (P = t == null ? void 0 : t.hooks) != null && P.emit && !((C = (j = this.options.skipSnippets) == null ? void 0 : j.includes) != null && C.call(j, "htmlScript"))) {
root: (o = t == null ? void 0 : t.options) == null ? void 0 : o.context
}, n = ((f = t == null ? void 0 : t.options) == null ? void 0 : f.cache) || ((b = (h = t == null ? void 0 : t.options) == null ? void 0 : h.experiments) == null ? void 0 : b.cache);
if ((n == null ? void 0 : n.type) === "filesystem" && (this.options.cache ? (e.port = this.options.port || ((k = F(e)) == null ? void 0 : k.previousPort), D(this.options, e, !0)) : n.version = "code-inspector-".concat(Date.now())), q(v(d({}, this.options), { record: e }), t), (A = t == null ? void 0 : t.hooks) != null && A.emit && !((x = (y = this.options.skipSnippets) == null ? void 0 : y.includes) != null && x.call(y, "htmlScript"))) {
const E = this.options;
t.hooks.emit.tapAsync(
"WebpackCodeInspectorPlugin",
(g, T) => d(this, null, function* () {
(g, T) => c(this, null, function* () {
let l = {};
g.getAssets ? l = yield g.getAssets() : l = g.assets, yield q({
g.getAssets ? l = yield g.getAssets() : l = g.assets, yield B({
options: E,
record: s,
record: e,
assets: l

@@ -178,3 +179,3 @@ }), T();

export {
K as default
M as default
};

@@ -1,1 +0,1 @@

(function(n,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s(require("@code-inspector/core"),require("path")):typeof define=="function"&&define.amd?define(["@code-inspector/core","path"],s):(n=typeof globalThis!="undefined"?globalThis:n||self,n.WebpackCodeInspectorPlugin=s(n.core,n.path))})(this,function(n,s){"use strict";var q=Object.defineProperty,z=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var S=(n,s,i)=>s in n?q(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i,j=(n,s)=>{for(var i in s||(s={}))O.call(s,i)&&S(n,i,s[i]);if(L)for(var i of L(s))F.call(s,i)&&S(n,i,s[i]);return n},C=(n,s)=>z(n,N(s));var x=(n,s,i)=>new Promise((A,l)=>{var P=a=>{try{h(i.next(a))}catch(p){l(p)}},c=a=>{try{h(i.throw(a))}catch(p){l(p)}},h=a=>a.done?A(a.value):Promise.resolve(a.value).then(P,c);h((i=i.apply(n,s)).next())});var i=typeof document!="undefined"?document.currentScript:null;function A(t,e){return x(this,null,function*(){if(!t||!e)return[];const o=typeof t=="function"?yield t():t;let u=[];if(typeof o=="object"&&!Array.isArray(o))for(const f in o){const r=o[f],d=r.import||r;l(u,d,e)}else l(u,o,e);return u.filter(f=>!!f)})}function l(t,e,o){typeof e=="string"?t.push(P(e,o)):Array.isArray(e)&&t.push(...e.map(u=>P(u,o)))}function P(t,e){return s.isAbsolute(t)?n.normalizePath(t):t.startsWith(".")?s.resolve(e,n.normalizePath(t)):""}let c="";typeof __dirname!="undefined"?c=__dirname:c=s.dirname(n.fileURLToPath(typeof document=="undefined"&&typeof location=="undefined"?require("url").pathToFileURL(__filename).href:typeof document=="undefined"?location.href:i&&i.src||new URL("index.umd.js",document.baseURI).href));let h=!0;const a=(t,e)=>{var r,d;if(!h)return;h=!1;const o=(e==null?void 0:e.compiler)||e,u=(r=o==null?void 0:o.options)==null?void 0:r.module;((u==null?void 0:u.rules)||(u==null?void 0:u.loaders)||[]).push(j({test:(d=t.match)!=null?d:/\.html$/,resourceQuery:/vue/,use:[{loader:s.resolve(c,"./loader.js"),options:t}]},t.enforcePre===!1?{}:{enforce:"pre"}),j({test:/\.(vue|jsx|tsx|js|ts|mjs|mts|svelte)$/,use:[{loader:s.resolve(c,"./loader.js"),options:t}]},t.enforcePre===!1?{}:{enforce:"pre"}),C(j({},t.injectTo?{resource:t.injectTo}:{test:/\.(jsx|tsx|js|ts|mjs|mts)$/,exclude:/node_modules/}),{use:[{loader:s.resolve(c,"./inject-loader.js"),options:t}],enforce:n.isNextjsProject()?"pre":"post"}))};function p(t,e){return n.getCodeWithWebComponent({options:C(j({},t),{importClient:"code"}),file:"main.js",code:"",record:e,inject:!0})}function E(u){return x(this,arguments,function*({options:t,record:e,assets:o}){const f=Object.keys(o).filter(r=>/\.html$/.test(r));if(f.length){const r=yield p(t,e);f.forEach(d=>{var y,b;const v=(b=(y=o[d])==null?void 0:y.source)==null?void 0:b.call(y);if(typeof v=="string"){const g=v.replace("<head>",'<head><script type="module">\n'.concat(r,"\n<\/script>"));o[d]={source:()=>g,size:()=>g.length}}})}})}class I{constructor(e){this.options=e}apply(e){return x(this,null,function*(){var u,f,r,d,v,y,b,g,T,W,$,k,D;if(h=!0,this.options.close||!n.isDev(this.options.dev,((u=e==null?void 0:e.options)==null?void 0:u.mode)==="development"||process.env.NODE_ENV==="development"))return;const o={port:0,entry:"",output:this.options.output,inputs:A((f=e==null?void 0:e.options)==null?void 0:f.entry,(r=e==null?void 0:e.options)==null?void 0:r.context),envDir:(d=e==null?void 0:e.options)==null?void 0:d.context,root:(v=e==null?void 0:e.options)==null?void 0:v.context};if(((b=(y=e==null?void 0:e.options)==null?void 0:y.cache)==null?void 0:b.type)==="filesystem"&&(this.options.cache?p(this.options,o):e.options.cache.version="code-inspector-".concat(Date.now())),((W=(T=(g=e==null?void 0:e.options)==null?void 0:g.experiments)==null?void 0:T.cache)==null?void 0:W.type)==="persistent"&&(this.options.cache?p(this.options,o):e.options.experiments.cache.version="code-inspector-".concat(Date.now())),a(C(j({},this.options),{record:o}),e),($=e==null?void 0:e.hooks)!=null&&$.emit&&!((D=(k=this.options.skipSnippets)==null?void 0:k.includes)!=null&&D.call(k,"htmlScript"))){const R=this.options;e.hooks.emit.tapAsync("WebpackCodeInspectorPlugin",(_,U)=>x(this,null,function*(){let w={};_.getAssets?w=yield _.getAssets():w=_.assets,yield E({options:R,record:o,assets:w}),U()}))}})}}return I});
(function(s,n){typeof exports=="object"&&typeof module!="undefined"?module.exports=n(require("@code-inspector/core"),require("path")):typeof define=="function"&&define.amd?define(["@code-inspector/core","path"],n):(s=typeof globalThis!="undefined"?globalThis:s||self,s.WebpackCodeInspectorPlugin=n(s.core,s.path))})(this,function(s,n){"use strict";var q=Object.defineProperty,z=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var R=(s,n,r)=>n in s?q(s,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[n]=r,j=(s,n)=>{for(var r in n||(n={}))O.call(n,r)&&R(s,r,n[r]);if(L)for(var r of L(n))F.call(n,r)&&R(s,r,n[r]);return s},C=(s,n)=>z(s,N(n));var b=(s,n,r)=>new Promise((A,l)=>{var k=a=>{try{h(r.next(a))}catch(y){l(y)}},c=a=>{try{h(r.throw(a))}catch(y){l(y)}},h=a=>a.done?A(a.value):Promise.resolve(a.value).then(k,c);h((r=r.apply(s,n)).next())});var r=typeof document!="undefined"?document.currentScript:null;function A(t,e){return b(this,null,function*(){if(!t||!e)return[];const o=typeof t=="function"?yield t():t;let u=[];if(typeof o=="object"&&!Array.isArray(o))for(const f in o){const i=o[f],d=i.import||i;l(u,d,e)}else l(u,o,e);return u.filter(f=>!!f)})}function l(t,e,o){typeof e=="string"?t.push(k(e,o)):Array.isArray(e)&&t.push(...e.map(u=>k(u,o)))}function k(t,e){return n.isAbsolute(t)?s.normalizePath(t):t.startsWith(".")?n.resolve(e,s.normalizePath(t)):""}let c="";typeof __dirname!="undefined"?c=__dirname:c=n.dirname(s.fileURLToPath(typeof document=="undefined"&&typeof location=="undefined"?require("url").pathToFileURL(__filename).href:typeof document=="undefined"?location.href:r&&r.src||new URL("index.umd.js",document.baseURI).href));let h=!0;const a=(t,e)=>{var i,d;if(!h)return;h=!1;const o=(e==null?void 0:e.compiler)||e,u=(i=o==null?void 0:o.options)==null?void 0:i.module;((u==null?void 0:u.rules)||(u==null?void 0:u.loaders)||[]).push(j({test:(d=t.match)!=null?d:/\.html$/,resourceQuery:/vue/,use:[{loader:n.resolve(c,"./loader.js"),options:t}]},t.enforcePre===!1?{}:{enforce:"pre"}),j({test:/\.(vue|jsx|tsx|js|ts|mjs|mts|svelte)$/,use:[{loader:n.resolve(c,"./loader.js"),options:t}]},t.enforcePre===!1?{}:{enforce:"pre"}),C(j({},t.injectTo?{resource:t.injectTo}:{test:/\.(jsx|tsx|js|ts|mjs|mts)$/,exclude:/node_modules/}),{use:[{loader:n.resolve(c,"./inject-loader.js"),options:t}],enforce:s.isNextjsProject()?"pre":"post"}))};function y(t,e,o){return s.getCodeWithWebComponent({options:C(j({},t),{importClient:"code"}),file:"main.js",code:"",record:e,inject:!0,server:o})}function S(u){return b(this,arguments,function*({options:t,record:e,assets:o}){const f=Object.keys(o).filter(i=>/\.html$/.test(i));if(f.length){const i=yield y(t,e);f.forEach(d=>{var p,P;const v=(P=(p=o[d])==null?void 0:p.source)==null?void 0:P.call(p);if(typeof v=="string"){const g=v.replace("<head>",'<head><script type="module">\n'.concat(i,"\n<\/script>"));o[d]={source:()=>g,size:()=>g.length}}})}})}class E{constructor(e){this.options=e}apply(e){return b(this,null,function*(){var f,i,d,v,p,P,g,W,w,$,x,D;if(h=!0,this.options.close||!s.isDev(this.options.dev,((f=e==null?void 0:e.options)==null?void 0:f.mode)==="development"||process.env.NODE_ENV==="development"))return;const o={port:0,entry:"",output:this.options.output,inputs:A((i=e==null?void 0:e.options)==null?void 0:i.entry,(d=e==null?void 0:e.options)==null?void 0:d.context),envDir:(v=e==null?void 0:e.options)==null?void 0:v.context,root:(p=e==null?void 0:e.options)==null?void 0:p.context},u=((P=e==null?void 0:e.options)==null?void 0:P.cache)||((W=(g=e==null?void 0:e.options)==null?void 0:g.experiments)==null?void 0:W.cache);if((u==null?void 0:u.type)==="filesystem"&&(this.options.cache?(o.port=this.options.port||((w=s.getProjectRecord(o))==null?void 0:w.previousPort),y(this.options,o,!0)):u.version="code-inspector-".concat(Date.now())),a(C(j({},this.options),{record:o}),e),($=e==null?void 0:e.hooks)!=null&&$.emit&&!((D=(x=this.options.skipSnippets)==null?void 0:x.includes)!=null&&D.call(x,"htmlScript"))){const I=this.options;e.hooks.emit.tapAsync("WebpackCodeInspectorPlugin",(_,U)=>b(this,null,function*(){let T={};_.getAssets?T=yield _.getAssets():T=_.assets,yield S({options:I,record:o,assets:T}),U()}))}})}}return E});
{
"name": "@code-inspector/webpack",
"version": "1.3.0",
"version": "1.3.1",
"main": "./dist/index.umd.js",

@@ -43,3 +43,3 @@ "module": "./dist/index.mjs",

"dependencies": {
"@code-inspector/core": "1.3.0"
"@code-inspector/core": "1.3.1"
},

@@ -46,0 +46,0 @@ "devDependencies": {