Skip to content

Allow SDK to be be browserified without custom scripts #386

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

Merged
merged 4 commits into from
Oct 16, 2014

Conversation

lsegal
Copy link
Contributor

@lsegal lsegal commented Oct 15, 2014

This patch allows the SDK to work with browserify out of the box. Consider the following application code that uses the SDK:

// index.js
var AWS = require('aws-sdk');
var s3 = new AWS.S3;

Currently, this file would not work with:

$ browserify index.js > out.js

This patch allows the above command to succeed with the default SDK browser build. This patch also allows for custom services to be specified when browserifying via AWS_SERVICES:

$ AWS_SERVICES=ec2 browserify index.js > out.js

This relates to #383

Works without any custom code. Note that by default only the
default services will be included in the browserified aws-sdk
build. In order to build other services, you can pass the
`AWS_SERVICES` environment variable to browserify:

    AWS_SERVICES=s3,ec2,dynamodb browserify myscript.js > out.js

The above command includes only Amazon S3, Amazon EC2, and Amazon
DynamoDB in the generated SDK. You can use "all" to include all
services.

See #383
Caching logic was incompatible with new build format,
as caching worked by generating service cache data outside of
core module. Services are now built inside of the context of
the core module.

dist-tools was refactored to use the new transform function
to drive building of service code.
AdityaManohar added a commit that referenced this pull request Oct 16, 2014
Allow SDK to be be browserified without custom scripts

Closes #383
@AdityaManohar AdityaManohar merged commit 6602c26 into master Oct 16, 2014
@AdityaManohar AdityaManohar deleted the npm-browserifiable branch October 16, 2014 18:33
@AdityaManohar AdityaManohar restored the npm-browserifiable branch October 16, 2014 18:33
lsegal added a commit that referenced this pull request Oct 16, 2014
@lock
Copy link

lock bot commented Sep 28, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2019
@trivikr trivikr deleted the npm-browserifiable branch January 5, 2021 02:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants