question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module or jsnext:main in package.json

See original GitHub issue

Since 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
danbucholtzcommented, Jan 3, 2017

@Urigo,

Looks reasonable to me at first glance.

Thanks, Dan

0reactions
helfercommented, Jan 10, 2017

@danbucholtz let us know if this issue is solved with the new release for you!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found