-
Notifications
You must be signed in to change notification settings - Fork 231
Smaller bundle #7013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Smaller bundle #7013
Changes from all commits
66b3c93
74a2dbe
80bec98
7d2e82b
2fc10d7
eabc031
303ce3b
cdf329f
8f75609
d31c979
6e2d804
0c6f5ca
715bdbd
d9bb563
982d6c4
95b5321
a32d91d
1eaab72
7099347
6f58b49
766c9b6
c2d577a
2f363e9
696e5f7
195248b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ const hydrogenAssets = joinPath(hydrogenPath, 'dist/assets/hydrogen/**/*') | |
|
|
||
| esBuild({ | ||
| bundle: true, | ||
| entryPoints: ['./src/**/*.ts'], | ||
| entryPoints: ['./src/index.ts'], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change from globbing all .ts files to a single The ProblemThe oclif configuration in packages/cli/package.json expects these hook files: "hooks": {
"prerun": "./dist/hooks/prerun.js",
"postrun": "./dist/hooks/postrun.js"
}These source files exist:
However, packages/cli/src/index.ts does NOT import or export these hooks. They are meant to be standalone files per oclif convention. ImpactWith the old config (
With the new config (
Fix Options
|
||
| outdir: './dist', | ||
| platform: 'node', | ||
| format: 'esm', | ||
|
|
@@ -58,9 +58,9 @@ esBuild({ | |
| splitting: true, | ||
| // these tree shaking and minify options remove any in-source tests from the bundle | ||
| treeShaking: true, | ||
| minifyWhitespace: false, | ||
| minifyWhitespace: true, | ||
| minifySyntax: true, | ||
| minifyIdentifiers: false, | ||
| minifyIdentifiers: true, | ||
|
|
||
| plugins: [ | ||
| ShopifyVSCodePlugin, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,7 @@ | |
| "/bin/run.cmd", | ||
| "/bin/run.js", | ||
| "/dist", | ||
| "!/dist/**/*.map", | ||
| "/oclif.manifest.json" | ||
| ], | ||
| "scripts": { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Ref Line 56) 🐛 Bug: The configuration uses
sourcemap: true, which generates inline sourcemaps embedded directly in the .js files rather than separate .map files. This means the!/dist/**/*.mapexclusion in package.json has no effect, and sourcemaps are shipped to npm users inside the bundles, directly contradicting the PR's goal of reducing bundle size by ~55%. An earlier commit noted that disabling sourcemaps saved 35,752 KB.Suggestion:
This will generate separate .map files that can be uploaded to Observe while being excluded from the npm package via the existing
!/dist/**/*.mappattern.