| 175 | } |
| 176 | |
| 177 | const createVisualizationReport = (paths: ReadonlyArray<string>, outputDirectory: string): string => { |
| 178 | const lines: Array<string> = [ |
| 179 | "| File Name | Generated Bundle | Treemap | Raw Data |", |
| 180 | "|:----------|:----------------|:--------|:---------|" |
| 181 | ] |
| 182 | for (const entryPath of paths) { |
| 183 | const name = path.parse(entryPath).name |
| 184 | const filename = path.relative(currentDirectory, path.resolve(entryPath)) |
| 185 | const minified = path.join(outputDirectory, `${name}.min.js`) |
| 186 | const treemap = path.join(outputDirectory, `${name}.treemap.html`) |
| 187 | const rawData = path.join(outputDirectory, `${name}.raw-data.json`) |
| 188 | lines.push(`| \`${filename}\` | \`${minified}\` | \`${treemap}\` | \`${rawData}\` |`) |
| 189 | } |
| 190 | return lines.join("\n") + "\n" |
| 191 | } |
| 192 | |
| 193 | const report = Effect.fn("Reporter.report")( |
| 194 | function*(options: ReportOptions) { |