From c148e2f3d96f3e62fef9ee63c0cd52943b3160ab Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Fri, 17 Feb 2023 22:37:13 +0000 Subject: [PATCH] Added esbuild bundle inspection metafile --- .gitignore | 4 +++- dev/build/esbuild.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 90b80e7b8..5f3aa6600 100644 --- a/.gitignore +++ b/.gitignore @@ -21,8 +21,10 @@ yarn.lock nbproject .buildpath .project +.nvmrc .settings/ webpack-stats.json .phpunit.result.cache .DS_Store -phpstan.neon \ No newline at end of file +phpstan.neon +esbuild-meta.json \ No newline at end of file diff --git a/dev/build/esbuild.js b/dev/build/esbuild.js index 57a224876..2ff7ac1f4 100644 --- a/dev/build/esbuild.js +++ b/dev/build/esbuild.js @@ -2,6 +2,7 @@ const esbuild = require('esbuild'); const path = require('path'); +const fs = require('fs'); // Check if we're building for production // (Set via passing `production` as first argument) @@ -19,6 +20,7 @@ const outdir = path.join(__dirname, '../../public/dist'); // Build via esbuild esbuild.build({ bundle: true, + metafile: true, entryPoints, outdir, sourcemap: true, @@ -27,4 +29,6 @@ esbuild.build({ format: 'esm', minify: isProd, logLevel: "info", +}).then(result => { + fs.writeFileSync('esbuild-meta.json', JSON.stringify(result.metafile)); }).catch(() => process.exit(1)); \ No newline at end of file