Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukebennett88/dual-package-example
https://github.com/lukebennett88/dual-package-example
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lukebennett88/dual-package-example
- Owner: lukebennett88
- Created: 2023-10-17T08:09:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-17T22:23:08.000Z (about 1 year ago)
- Last Synced: 2024-10-11T04:08:13.967Z (28 days ago)
- Language: TypeScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dual Package Example
This is a demo project that compiles a package with [tsup](https://github.com/egoist/tsup), using named and default exports, as well as a subpath export.
It showcases an error related to the usage of default exports.
```shell
cd packages/package-a
pnpm check
```After running this you should see this:
```shell
Build tools:
- @arethetypeswrong/cli@^0.12.2
- typescript@^5.2.2π€¨ CommonJS module simulates a default export with exports.default and exports.__esModule, but does not also set module.exports for compatibility with Node. Node, and some bundlers under certain conditions, do not respect the __esModule marker, so accessing the intended default export will require a .default property access on the default import. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/CJSOnlyExportsDefault.md
βββββββββββββββββββββ¬ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β β "package-a" β "package-a/second-entrypoint" β "package-a/package.json" β
βββββββββββββββββββββΌββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ€
β node10 β π€¨ CJS default export β π’ β π’ (JSON) β
βββββββββββββββββββββΌββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ€
β node16 (from CJS) β π€¨ CJS default export β π€¨ CJS default export β π’ (JSON) β
βββββββββββββββββββββΌββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ€
β node16 (from ESM) β π’ (ESM) β π’ (ESM) β π’ (JSON) β
βββββββββββββββββββββΌββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ€
β bundler β π’ β π’ β π’ (JSON) β
βββββββββββββββββββββ΄ββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββ
βELIFECYCLEβ Command failed with exit code 1.
```