Skip to content

Commit

Permalink
Dog fooding
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed May 2, 2024
1 parent d74eb82 commit 403371b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
else
echo 'clean'
fi
- name: Analyze esbuild bundle size
uses: exoego/esbuild-bundle-analyzer@main
with:
metafiles: "tmp/meta.json"
- uses: actions/upload-artifact@v4
with:
name: dist
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
node_modules
out
.analyzer
tmp/meta.json

# Allow-list
!__tests__/__fixtures__/examples-with-base/**/.analyzer/base/bundle/bundle_analysis.json
6 changes: 4 additions & 2 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as esbuild from 'esbuild'
import { readFileSync } from 'node:fs'
import { readFileSync, writeFileSync } from 'node:fs'

// https://github.com/evanw/esbuild/issues/1685#issuecomment-944916409
const excludeNodeModulesFromSourceMap = {
Expand All @@ -18,7 +18,7 @@ const excludeNodeModulesFromSourceMap = {
},
};

await esbuild.build({
const result = await esbuild.build({
entryPoints: [`./src/index.ts`],
outfile: `dist/index.mjs`,
format: 'esm',
Expand All @@ -30,3 +30,5 @@ await esbuild.build({
bundle: true,
plugins: [excludeNodeModulesFromSourceMap]
})

writeFileSync(`tmp/meta.json`, JSON.stringify(result.metafile, null, 2));
Empty file added tmp/.gitkeep
Empty file.

0 comments on commit 403371b

Please sign in to comment.