Open Alxandr opened 5 years ago
Just ran into this when trying to troubleshoot #931. Isn't this a trivial change to make?
One thing I noticed is that the minified and unminified sources seem to differ slightly in the objects/classes they expose. This was a bit hard to tackle while also trying to debug. Definitely should be changed for 2.0 due to that.
Making this change would allow packaging utilities to apply tree shaking to eliminate unused code in the library too.
I agree that exposing the minified version is not good for integration and troubleshooting.
However, the /lib/oidc-client.js
is already transpiled and changed.
I think that the library should have:
main
(code transpiled to CommonJS)module
(ejs code)>browser
(transpiled browser compatible code).Then most modern bundlers can automatically pick up the right one.
Since this issue and the related PR have been stuck for more than 6 months, I'd like to ask the maintainers if implementing a new build like this is something that you'd take as a PR or you want to keep things as they are, @brockallen .
Using the minified version as main
renders the lib practically un-debuggable in a dev env.
As a workaround, you can manually edit node_modules/oidc-client/package.json
, but you'll have to do it every time it is overwritten.
Had to do what OP did today. This user did too: https://github.com/IdentityModel/oidc-client-js/issues/1044#issuecomment-591625560
This is quick to fix yourself when you know where to look, but otherwise it's another hurdle you need to jump over to debug your app.
ping @brockallen did you see my comment above?
Honestly speaking, https://github.com/manfredsteyer/angular-oauth2-oidc is much-much better for Angular.
Having minified sources be the "main" makes things much harder to debug. Minification should be an issue for the end client and how they want to setup webpack or similar, not the individual libraries.