LoginRadius / node-js-sdk

The LoginRadius Node JS library will let you integrate LoginRadius' customer identity platform with your Node JS application(s).
https://www.loginradius.com
MIT License
9 stars 21 forks source link

Support for Webpack #15

Open aaron-lang-auroramj opened 4 years ago

aaron-lang-auroramj commented 4 years ago

Does this SDK support being bundled with webpack?

Several lines like

config.HELPER_PATH = path.join(__dirname, 'helper.js');
var helper = require(config.HELPER_PATH);

generate errors: Critical dependency: the request of a dependency is an expression

Is there a workaround?

Would you accept a PR fixing this?

karmanya007 commented 4 years ago

For js files in asset folder, right?

aaron-lang-auroramj commented 4 years ago

Not sure I understand your question.

I have a project that requires this SDK. When I build that with webpack, webpack traverses the dependency tree and bundles all required modules into a single file.

Because of the way this SDK uses require webpack is not able to determine at build time which modules are being required and cannot include them.

Changing this line and others to something more like require('./helper.js') would allow webpack to determine which modules are being required at build time.

indrasen715 commented 3 years ago

Hi @aaron-lang-auroramj ,

Thanks for bringing this to our notice and we appreciate your valuable feedback on this. I will review this feedback with the team, and keep you posted on the progress.

Regards Indrasen

dbrenot-pelmorex commented 1 year ago

The PR i'm working on should address this issue: #25