Running a local 'CDN'

Bosco has a command that allows you to mimic the structure of a CDN locally - this is to allow your code to not have a special 'development' mode that contains all of the un-minified JS and CSS. This command spins up a local HTTP server to serve up the assets.

All of the examples below use a service with the following configuration:

    "tags":["review", "summary", "admin"],
        "name": "resource-reviews",
        "command":"node_modules/.bin/gulp build",
        "watch": {
            "ready":"Finished 'default'"
    "assets": {
        "basePath": "/src/public",
        "js": {
            "bottom": [
            "bottom-v2" : [
        "css": {
            "main-v2": [
            "main": [

Default 'local' mode

To launch bosco in local mode, simply type:

bosco cdn

The default command will run across all repositories, pull together all of the source assets into HTML fragments for Compoxure (or your other code) to use.

The contents of the bottom JS fragment is:

<!-- Generated by Bosco -->
<script src=""></script>
<script src=""></script>
<script src=""></script>

As you can see, this mode does not minify the assets, and so you can't programmatically generate the url for any of the static asset bundles - as it hasn't actually created any of them!

The advantage of operating in this mode is that all of the javascript includes are broken out into the individual files that are included in the projects, so it makes it easier to debug. Note that in the minified mode you still get access to source maps, but that mode is slightly clunkier to work with.


URL Pattern


Minified 'local' mode

If you want to run locally with minified assets, simply type:

bosco cdn minify

This does the same process as above, but now minifies the static assets together into the bundles specified in the bosco-service.json file.

After running this step, you will have exactly the same HTML fragments:

But now the content of this file is different:

<!-- Generated by Bosco -->
<script src=""></script>

It now points to the minified file.

What this means is that you can have a composition layer (e.g. Compoxure) pull in exactly the same HTML fragment, and the assets will be served either minified or not depending on how you configure Bosco - it is transparent to the upstream projects.