(content: Buffer)
| 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`, |
nothing calls this directly
no test coverage detected