({
id,
code,
}: {
id: string;
code: string | null;
})
| 209 | : defaultSizeGetter; |
| 210 | |
| 211 | const getModuleLengths = async ({ |
| 212 | id, |
| 213 | code, |
| 214 | }: { |
| 215 | id: string; |
| 216 | code: string | null; |
| 217 | }): Promise<ModuleLengths & { id: string }> => { |
| 218 | const isCodeEmpty = code == null || code == ""; |
| 219 | |
| 220 | const result = { |
| 221 | id, |
| 222 | gzipLength: isCodeEmpty ? 0 : await gzipSizeGetter(code), |
| 223 | brotliLength: isCodeEmpty ? 0 : await brotliSizeGetter(code), |
| 224 | renderedLength: isCodeEmpty ? 0 : Buffer.byteLength(code, "utf-8"), |
| 225 | }; |
| 226 | return result; |
| 227 | }; |
| 228 | |
| 229 | if (opts.sourcemap && !outputOptions.sourcemap) { |
| 230 | this.warn(WARN_SOURCEMAP_DISABLED); |
nothing calls this directly
no outgoing calls
no test coverage detected