Skip to content

Commit

Permalink
feat: Add subpath export for initializeInpageProvider.cjs
Browse files Browse the repository at this point in the history
Add a subpath export for the `initializeInpageProvider.cjs` file. This
allows projects with legacy build systems to import this file directly,
which can be useful for reducing bundle size (especially for build
systems without tree shaking).

The `metamask-extension` project uses two build systems: one which
obeys export maps, one which ignores them (Webpack and browserify
respectively). The existing `initializeInpageProvider` export map entry
doesn't work for browserify because it's looking for
`initializeInpageProvider.js`. The file extension is wrong.
  • Loading branch information
Gudahtt committed Nov 27, 2024
1 parent 8464e2b commit c242046
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
"default": "./dist/initializeInpageProvider.cjs"
}
},
"./dist/initializeInpageProvider.cjs": {
"types": "./dist/initializeInpageProvider.d.cts",
"default": "./dist/initializeInpageProvider.cjs"
},
"./stream-provider": {
"import": {
"types": "./dist/StreamProvider.d.mts",
Expand Down

0 comments on commit c242046

Please sign in to comment.