-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 Support #1123
Webpack Support #1123
Conversation
…ersion of the SDK
…ing the browser version of the SDK. Updated browser-builder cli to handle changes made to how the SDK loads browser services. Added crypto-browserify and buffer as dependencies to allow us greater control over deps, and to help compatibility with 3rd party tools. Added script to generate browser service files.
1 similar comment
@@ -0,0 +1,14 @@ | |||
require('../lib/node_loader'); | |||
var AWS = require('../lib/core'); | |||
var Service = require('../lib/service'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core.js
already requires service.js
, and the Service
constructor can already be accessed at AWS.Service
. Why does it need to be required here? We also wouldn't need to export Service
in service.js
pending changes |
Changes made, merging! |
- Update README.md to use new aws-sdk webpack support. - Simplify NPM install by making the dependencies direct. This is apparently OK for aws-sdk to do, so we may as well make it nicer for the end-user. - Remove old grunt build and deps.
Looks good! I hit an issue where using the non-client public APIs like default config or import { config, CognitoIdentityCredentials } from 'aws-sdk/lib/core'; |
Also the changes to |
Damn, just noticed that if you load |
@simonbuchan |
That is much better, although it still also adds it to the global which is On Sat, 10 Sep 2016, 02:30 Christopher Radek notifications@github.com
|
Update to use aws/aws-sdk-js#1123 explicit webpack support.
@chrisradek As this change has been merged, can information about using with Webpack be added to the documentation? https://github.com/aws/aws-sdk-js/blob/master/doc-src/guide/browser-intro.md |
@kellyjanderson The updated link to the new guide is in our readme: The new guide is maintained separately from this repo, but we can remove the old guide to avoid confusion. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
This PR allows the SDK to be used with webpack.
It also allows webpack and browserify to generate node bundles that include the SDK.
Services can also now be required individually. For example, you can require the S3 service in your code by doing the following:
To get access to the AWS namespace (useful when sharing config across multiple services), you can do the following:
Of course, you can continue to use the SDK as usual:
Notes:
For webpack, you will still need to add a json loader to your configuration.