Skip to content

Webpack support #603

@anthonator

Description

@anthonator

Has anybody gotten this library to work with webpack? The webpack team recently fixed a ternary require issue which fixed a show stopper.

I was able to fix an issue with loading a JSON file with the json-loader. Now I'm getting:

WARNING in ./~/aws-sdk/lib/util.js
Critical dependencies:
40:30-45 the request of a dependency is an expression
43:11-53 the request of a dependency is an expression
 @ ./~/aws-sdk/lib/util.js 40:30-45 43:11-53

WARNING in ./~/aws-sdk/lib/api_loader.js
Critical dependencies:
13:15-59 the request of a dependency is an expression
104:12-46 the request of a dependency is an expression
108:21-58 the request of a dependency is an expression
114:18-52 the request of a dependency is an expression

Which is causing the individual services to not be included in the packaged bundle.

So doing new AWS.S3() returns a is not a function error.

It looks like you might be able to fix this with the ContextReplacementPlugin but I'm not sure how to configure it properly for this scenario.

Does anybody have any examples or anything?

Metadata

Metadata

Assignees

Labels

feature-requestA feature should be added or improved.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions