Sha256: 208f5678e0ec29757204748e91437f65871bc9ea927d62e1071742cecbe7020c

Contents?: true

Size: 746 Bytes

Versions: 8

Compression:

Stored size: 746 Bytes

Contents

import esbuild from "esbuild";
import path from "path";
import fs from "fs";
import config from "../../config/esbuild.config.mjs";

const metafilePath = "tmp/bundle-metadata.json";

function ensureDirectoryExistence(filePath) {
  var dirname = path.dirname(filePath);
  if (fs.existsSync(dirname)) {
    return true;
  }
  ensureDirectoryExistence(dirname);
  fs.mkdirSync(dirname);
}

ensureDirectoryExistence(metafilePath);

esbuild.build({ ...config, metafile: true }).then((result) => {
  fs.writeFileSync(metafilePath, JSON.stringify(result.metafile));
  console.log("\nāœ… Bundle metadata file generated.");

  console.log(
    `šŸ‘€ You can now upload '${metafilePath}' to https://esbuild.github.io/analyze/ for bundle analysis.`
  );
});

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 lib/scripts/esbuild-meta.mjs
coveragebook_components-0.19.7 lib/scripts/esbuild-meta.mjs
coveragebook_components-0.19.6 lib/scripts/esbuild-meta.mjs
coveragebook_components-0.19.5 lib/scripts/esbuild-meta.mjs
coveragebook_components-0.19.4 lib/scripts/esbuild-meta.mjs
coveragebook_components-0.19.3 lib/scripts/esbuild-meta.mjs
coveragebook_components-0.19.2 lib/scripts/esbuild-meta.mjs
coveragebook_components-0.19.1 lib/scripts/esbuild-meta.mjs