fix: correctly flag targets for Node resolution
Why
Fixes #153
What
We need to clearly mark CJS/ESM targets for Node to resolve correctly in environments like SSR. type="module" flags the package as a module (inferred for .js extensions) and .cjs is used to explicitly mark the main target as commonjs. Alternatively, we can simply use .mjs and .js but I'd prefer to play nicer on older web tools like CRA.
Checklist
- [ ] Documentation updated
- [ ] Storybook entry added
- [x] Ready to be merged
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit ef6a3351a15f711f5252ca85365c188585942976:
| Sandbox | Source |
|---|---|
| three-stdlib-ssr | Configuration |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| three-stdlib | ✅ Ready (Inspect) | Visit Preview | Sep 18, 2022 at 11:29AM (UTC) |
:tada: This PR is included in version 2.15.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket: