bundlesPath

  • property
config.bundlesPath {String}  

A configuration property for setting the path of where the production bundles folder is located.

String

A folder name that specifies the path to the production bundles. By default, bundlesPath is "dist/bundles". This path is relative to the page's baseURL. So, for example, if your script tag looks like:

Use

In production, the main module will be assumed to be within a "bundles/[MAIN_MODULE_NAME]" module. For example, if the main module is myapp, a bundles/myapp module is automatically configured to contain it:

<script src="node_modules/steal/steal.production.js"
        bundles-path="./out/bundles"
        main="myapp">
</script>

bundlesPath tells the client where all bundles can be found by configuring paths. For example, if bundlesPath is set to packages:

<script src="steal/steal.js"
        config="./config.js"
        main="myapp"
        env="production"
        bundles-path="packages">
</script>
<script>
    steal.config({
        bundles: {
            "bundles/myapp": ["myapp"]
        },
        paths: {
            "bundles/*": "packages/*.js",
            "bundles/*.css": "packages/*.css"
        }
    });
</script>

Often, bundlesPath should be the same value as what's passed in build. If bundlesPath is not set, it will set the default bundles paths:

<script src="node_modules/steal/steal.js"
        main="myapp"
        env="production"
        bundles-path="packages">
</script>
<script>
    steal.config({
        bundles: {
            "bundles/myapp": ["myapp"]
        },
        paths: {
            "bundles/*": "dist/bundles/*.js",
            "bundles/*.css": "dist/bundles/*.css"
        }
    });
</script>

If a path rule for paths["bundles/*"] or paths["bundles/*.css"] exist, bundlesPath will not overwrite them.

Help us improve StealJS by taking our community survey