okta / okta-auth-js

The official js wrapper around Okta's auth API
Other
437 stars 254 forks source link

Okta License appears in build 196 times #1484

Open Joee94 opened 5 months ago

Joee94 commented 5 months ago

Describe the bug

When running the production build of our app using okta-auth-js and okta-react the okta license is added into the js file 196 times, adding 122kb in size. Screenshot 2024-01-15 at 10 47 10

Reproduction Steps?

Using okta-auth-js and okta-react run a production build in vite with minify set to true In the output .js file should be a comment for every okta function.

SDK Versions

System: OS: macOS 13.6.2 CPU: (12) arm64 Apple M2 Pro Memory: 4.23 GB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node Yarn: 1.22.11 - ~/.nvm/versions/node/v18.19.0/bin/yarn npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm Browsers: Chrome: 120.0.6099.216 Safari: 17.2 npmPackages: @okta/okta-auth-js: ^7.5.0 => 7.5.0 @okta/okta-react: ^6.7.0 => 6.7.0

Additional Information?

This would be trivial to strip out as part of our build, but we're keen not to break any licensing laws and it would be good to have this potentially fixed on oktas side.

If this is not fixable on your side then it's important to know wether on not we can remove all but 1 of these licensing comments.

jaredperreault-okta commented 5 months ago

Thanks for pointing this out. We'll work on a fix on our side

In the meantime, you could try importing only the core bundle, rather than the default bundle (which includes everything in authjs). The core bundle should save a bit of bloat

import OktaAuth from '@okta/okta-auth-js/core';
Joee94 commented 5 months ago

Thanks for pointing this out. We'll work on a fix on our side

In the meantime, you could try importing only the core bundle, rather than the default bundle (which includes everything in authjs). The core bundle should save a bit of bloat

import OktaAuth from '@okta/okta-auth-js/core';

Thank you !

Joee94 commented 2 months ago

Any update on this? I see there is a branch here https://github.com/okta/okta-auth-js/tree/jp-esm-license but it's not been touched in a few months