MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / transform

Function transform

rspack.config.ts:147–162  ·  view source on GitHub ↗
(content: Buffer)

Source from the content-addressed store, hash-verified

145 to: `${dist}/ext`,
146 // 将manifest.json内版本号替换为package.json中版本号
147 transform(content: Buffer) {
148 const manifest = applyAgentManifest(
149 JSON.parse(content.toString()) as chrome.runtime.ManifestV3,
150 enableAgent
151 );
152 manifest.version = toChromeVersion(version);
153 if (isDev || isBeta) {
154 manifest.name = "__MSG_scriptcat_beta__";
155 }
156 if (isReactTools) {
157 manifest.content_security_policy = {
158 extension_pages: "script-src 'self' http://localhost:8097; object-src 'self'",
159 };
160 }
161 return JSON.stringify(manifest);
162 },
163 },
164 {
165 from: `${assets}/logo${isDev || isBeta ? "-beta" : ""}.png`,

Callers

nothing calls this directly

Calls 3

applyAgentManifestFunction · 0.90
toChromeVersionFunction · 0.90
parseMethod · 0.45

Tested by

no test coverage detected