Module or jsnext:main in package.json
See original GitHub issueSince this is a Typescript app, can you distribute es5
code (es5 target) with es2015
modules in addition to the commonjs
modules you distribute?
Set the moduleResolution
to node
as well to make everything work well in the tsconfig.json
.
jsnext:main
and module
are the fields that point to the entrypoint for the es5 code with es2015 modules. Angular uses module
and it seems most bundlers look for module
, then jsnext:main
, then main
in that order.
I’m happy to help more if needed.
Thanks, Dan
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
jsnext:main and module - Shuhei Kagawa
Node module's package.json has main property. It's the entry point of a package, which is exported when a client require s the package....
Read more >Confused about fields "module" and "jsnext:main" in package ...
Confused about fields "module" and "jsnext:main" in package.json? Why are both needed? I've been trying to google the exact reasoning behind ...
Read more >webpack babel jsnext:main and dependencies transpiling
1 Answer 1 ... The babel-loader is not transpiling anything in node_modules when you exclude node_modules from the rule. The fields like jsnext:...
Read more >package.json - npm Docs
Description. This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just...
Read more >package.json中main,jsnext:main,module的区别 - 张庆的笔记
package.json 中存在一些特殊字段, main,jsnext:main,module 的区别。经常使用npm 发布包时会用到他们。 但很多人无法理解具体区别,故在此阐明。
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 FreeTop 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
Top GitHub Comments
@Urigo,
Looks reasonable to me at first glance.
Thanks, Dan
@danbucholtz let us know if this issue is solved with the new release for you!