Skip to content

Commit

Permalink
Generate metafile to support esbuild bundle analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
raimohanska committed Mar 17, 2024
1 parent d4f7cf5 commit 0be2ce5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ async function build() {
if (fs.existsSync(DIST_FOLDER)) rimraf.sync(DIST_FOLDER)
const randomString = Math.random().toString(36).slice(2)
const outfile = path.resolve(CWD, `dist/bundle.${randomString}.js`)
const metafile = path.resolve(CWD, `dist/bundle.${randomString}.meta.json`)
const now = Date.now()
await esbuild.build({
entryPoints: [path.resolve(CWD, "src", "index.tsx")],
bundle: true,
minify: mode !== "watch",
outfile,
metafile,
sourcemap: true,
platform: "browser",
plugins: [sassPlugin, stubImportsPlugin(["path"])],
Expand Down

0 comments on commit 0be2ce5

Please sign in to comment.