Skip to content

Commit

Permalink
fix total size calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed Sep 8, 2024
1 parent ed6eb66 commit 5660b56
Show file tree
Hide file tree
Showing 16 changed files with 2,390 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ out
tmp/meta.json

# Allow-list
!__tests__/__fixtures__/examples-with-base/**/.analyzer/base/bundle/bundle_analysis.json
!__tests__/__fixtures__/**/.analyzer/base/bundle/bundle_analysis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"out/meta.json -> out/no-change-old.js": {
"bytes": 733190,
"metafile": "out/meta.json",
"outfile": "out/no-change-old.js"
},
"out/meta.json -> out/bit-increased-old.js": {
"bytes": 44674,
"metafile": "out/meta.json",
"outfile": "out/bit-increased-old.js"
},
"out/meta.json -> out/much-increased-old.js": {
"bytes": 44678,
"metafile": "out/meta.json",
"outfile": "out/much-increased-old.js"
},
"out/meta.json -> out/decreased-old.js": {
"bytes": 44658,
"metafile": "out/meta.json",
"outfile": "out/decreased-old.js"
},
"out/meta.json -> out/new-outfile-old.js": {
"bytes": 200,
"metafile": "out/meta.json",
"outfile": "out/new-outfile-old.js"
},
"out/meta.json -> out/file-imported-old.js": {
"bytes": 68068,
"metafile": "out/meta.json",
"outfile": "out/file-imported-old.js"
}
}
27 changes: 27 additions & 0 deletions __tests__/__fixtures__/issues/issue-90/esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { writeFileSync } from "node:fs";
import { build } from "esbuild";
import metaUrlPlugin from '@chialab/esbuild-plugin-meta-url';

const result = await build({
entryPoints: [
`./src/no-change.ts`,
`./src/bit-increased.ts`,
`./src/much-increased.ts`,
`./src/decreased.ts`,
`./src/new-outfile.ts`,
`./src/file-imported.ts`,
],
outdir: `out`,
format: "esm",
metafile: true,
mainFields: ["module", "main"],
platform: "node",
target: "node20.9",
bundle: true,
plugins: [
metaUrlPlugin(),
],
sourcemap: true,
});

writeFileSync(`out/meta.json`, JSON.stringify(result.metafile, null, 2));
Loading

0 comments on commit 5660b56

Please sign in to comment.