Skip to content

Commit

Permalink
Merge pull request #29 from arnklint/patch-1
Browse files Browse the repository at this point in the history
Update README to cover CDN usage
  • Loading branch information
Cowboy-coder committed Dec 17, 2012
2 parents e6a3cda + be9e8d9 commit c14baa0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Expand Up @@ -142,6 +142,28 @@ and this with `bundle:true`:
<script src='/generated/bundle/1e4b515_en_US.js' type='text/javascript'></script>
```

### Using CDN

Using bundle-up with a CDN is pretty straight forward. In this example we´ll use a Cloud Front URL as the `staticUrlRoot`.

``` js
BundleUp(app, __dirname + '/assets', {
staticRoot: __dirname + '/public/',
staticUrlRoot:'///drhu3hxlexxxx.cloudfront.net/',
bundle:true,
minifyCss: true,
minifyJs: true
});
```

When using Express, you can easily have the development environment skip the CDN.

``` js
var staticUrlRoot = app.get('env') == "production" ? '///drhu3hxlexxxx.cloudfront.net/' : "/";
...
staticUrlRoot: root
```

License
-------

Expand Down

0 comments on commit c14baa0

Please sign in to comment.