Skip to content

fix: build root shims export#161

Open
mojobeeping wants to merge 1 commit into
davidmyersdev:mainfrom
mojobeeping:mojobeep/restore-shims-root-export
Open

fix: build root shims export#161
mojobeeping wants to merge 1 commit into
davidmyersdev:mainfrom
mojobeeping:mojobeep/restore-shims-root-export

Conversation

@mojobeeping

Copy link
Copy Markdown

Summary

Restores the published vite-plugin-node-polyfills/shims export by building the aggregate shims entrypoint.

package.json currently exports ./shims to ./shims/dist/index.js and ./shims/dist/index.cjs, but the build only emits buffer, global, and process shims. A clean install of vite-plugin-node-polyfills@0.28.0 fails when importing the advertised root shims subpath:

ERR_MODULE_NOT_FOUND Cannot find module '.../node_modules/vite-plugin-node-polyfills/shims/dist/index.js'

This PR:

  • adds shims/index.ts as the aggregate shim entrypoint
  • adds build:shims:index so pnpm run build:shims emits shims/dist/index.js and shims/dist/index.cjs

Verification

pnpm run build
pnpm run test:unit
pnpm exec eslint shims/index.ts package.json
git diff --check

Packed tarball clean-consumer proof:

PUBLISHED_IMPORT_FAIL ERR_MODULE_NOT_FOUND Cannot find module '.../vite-plugin-node-polyfills/shims/dist/index.js'
PATCHED_ESM_OK function object object Blob,BlobOptions,Buffer,File,FileOptions,INSPECT_MAX_BYTES,SlowBuffer,TranscodeEncoding
PATCHED_CJS_OK function object object Blob,BlobOptions,Buffer,File,FileOptions,INSPECT_MAX_BYTES,SlowBuffer,TranscodeEncoding
PACK_HAS_ROOT_SHIMS true true true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant