estrella icon indicating copy to clipboard operation
estrella copied to clipboard

Metafile not being written

Open ldgrp opened this issue 2 years ago • 1 comments

Hi! I was trying to figure out the bundle size of an app and found that estrella does not output the metafiles produced by esbuild.

The following build.js file is expected to produce a metafile. https://esbuild.github.io/api/#metafile

#!/usr/bin/env node
const { build } = require("estrella")

build({
  entry: "src/main.ts",
  outfile: "dist/foo.js",
  metafile: true,
  bundle: true,
})

When using the javascript API for esbuild, it is up to the consumer to parse the result and write the metadata to a file. Currently, estrella simply passes the metafile property to esbuild, but does nothing with it. To keep things simple i propose:

  • for config.outdir : create a metafile in the output directory named ${config.outdir}.meta.json
  • for config.outfile : create a metafile in the output directory named ${config.outfile}.meta.json

ldgrp avatar Dec 14 '21 03:12 ldgrp

Bump

Darkle avatar Jun 19 '22 03:06 Darkle