ngx-cordova-oauth icon indicating copy to clipboard operation
ngx-cordova-oauth copied to clipboard

Module or jsnext:main in package.json

Open danbucholtz opened this issue 7 years ago • 5 comments

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.

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.

Happy to help with the process if needed.

Thanks, Dan

danbucholtz avatar Oct 05 '16 04:10 danbucholtz

Open to pull requests :-)

nraboy avatar Oct 06 '16 17:10 nraboy

Sorry, no time to help. I submitted this same issue to about 20 popular Angular 2 plugins.

I'll make some docs to make it easy. Right now your lib is not tree shakable and ships commonjs code instead of ES2015 code. Not the end of the world but not optimal either.

Thanks, Dan

danbucholtz avatar Oct 06 '16 17:10 danbucholtz

@nraboy I will take a look on that for you when I have a time and open a PR. This will let the lib organized and better to use with a single endpoint with all the es2015 compiled.

matheusrocha89 avatar Nov 10 '16 09:11 matheusrocha89

@nraboy I think @stalniy already did that on hist fork, am I right?

He did a great job BTW 👍 👏

matheusrocha89 avatar Nov 10 '16 09:11 matheusrocha89

Frankly speaking I haven't done this just because we are still on Angular rc.4 . In this week I plan to upgrade Angular and will probably do some stuff on this library as well

stalniy avatar Nov 21 '16 13:11 stalniy