Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack Bundling #48

Open
TaichiHo opened this issue Aug 31, 2016 · 3 comments
Open

Webpack Bundling #48

TaichiHo opened this issue Aug 31, 2016 · 3 comments

Comments

@TaichiHo
Copy link

Hi, I love this library a lot and want to use it in my production environment.

Right now I have this library as dependency and I am trying to packaging my application with webpack. Webpack complains about the dynamic require issues.

The default behavior of webpack is create a context object pointing to the current directory which in this case will not resolve the dependency.

Any ideas on improving this?

Thanks.

WARNING in ./~/npdynamodb/lib/migrate/migrator.js
Critical dependencies:
139:27-59 the request of a dependency is an expression
175:15-33 the request of a dependency is an expression
 @ ./~/npdynamodb/lib/migrate/migrator.js 139:27-59 175:15-33

WARNING in ./~/npdynamodb/lib/dialects/2012-08-10/api.js
Critical dependencies:
16:11-37 the request of a dependency is an expression
22:13-40 the request of a dependency is an expression
 @ ./~/npdynamodb/lib/dialects/2012-08-10/api.js 16:11-37 22:13-40
@noppoMan
Copy link
Owner

noppoMan commented Sep 1, 2016

@TaichiHo
Hi, thanks for using npdynamodb and really awesome thing to use it in production!

I see, I'll investigate it. give me a second.
(Actually it's mainly designed for server side so its browser support is little bit lazy haha..)

@TaichiHo
Copy link
Author

TaichiHo commented Sep 1, 2016

@noppoMan
Thanks for the reply.

I am actually using it on server side as well. I want to use webpack to bundle it and deploy to aws lambda.

For the migrator.js, it might be necessary to use the dynamic require. But for the api.js, it seems normal static require should be enough.

According to webpack, dynamic require is considered an anti-pattern.

Should be a easy fix.

Thanks you!

@wookieb
Copy link

wookieb commented Apr 8, 2017

I'm sorry. @TaichiHo Why do you need webpack in order to deploy it on AWS Lambda?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants