diff --git a/README.md b/README.md index f93746e..90cb175 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,28 @@ and this with `bundle:true`: ``` +### 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 -------