I want to make a nodejs application that uses the AWS SDK. However, it only really needs to use S3, and I want the application to have a small filesize.

AWS has a [custom sdk builder](https://sdk.amazonaws.com/builder/js/) which should make a custom SDK with only the required packages. Unfortunately, this doesn't work, even when I select all of the services. How do I make a custom SDK that works with node?

I've tried using the `npm install aws-sdk`, and that works, but it's 40MB. I've also tried selecting all of the services in the service builder (only 3MB), but that doesn't work.

It always gives an error at this line:

```
var aws = require("./aws-sdk-2.462.0.min.js");

```

```
ReferenceError: AWS is not defined
    at Object.<anonymous> (/home/cwaugh/workspaces/meta-lambda/aws-sdk-2.462.0.min.js:7:30180)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/cwaugh/workspaces/meta-lambda/handler.js:5:11)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)

```