package.main incorrectly set to cjs/index.js
See original GitHub issueRunning packemon build
sets the main
field on package.json
to ./cjs/index.cjs
but ./cjs/index.cjs
does not exist. I think it should be set to the value under exports["."].node
value which in this case points to an actual file: ./cjs/node.cjs
.
It also adds "src/**/*.{ts,tsx,json}"
to the files field. Is there a reason for this? Is there a way to make it not touch package.json
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
"Cannot find module" when main file not index.js with ... - GitHub
mjs files and I want to use extension-less import statements. I prefer to use Lib.js instead of index.js to distinguish in my IDE...
Read more >How to choose 'module' instead of 'main' file in package.json
I have some simple helper JS functions like this and this, and I would want them to be usable to the widest audience....
Read more >Hybrid npm packages (ESM and CommonJS) - 2ality
In this blog post, we look at npm packages that contain both ES modules and CommonJS modules.
Read more >Build a JavaScript library with multiple entry points using Vite3
In this post, I'll show how you can create a lib with multiple entry points (sub-modules) using Vite 3.
Read more >Firebase JavaScript SDK Release Notes - Google
Fixed some incorrect package.json paths to entry points in Authentication and Cloud Firestore. Realtime Database. Removed @firebase ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, now fixed!
@kaleidawave Wait, so this input:
Is writing to
cjs/node.cjs
and notcjs/index.cjs
? That seems like a bug.Also,
src
is included infiles
because they are required for source maps.