config

  • property
config.config {function(config)}  

Specifies configuration values for Steal. This should be used to set properties like configPath and env.

function(config)

Parameters

  1. config {Object}

    An object of configuration values.

    steal.config({
      map: {
        foo: 'bar'
      }
    });
    

Returns

{undefined}

Use

config can be called in four ways.

package.json

If using the npm plugin you can add config to your package.json's config property:

{
  "steal": {
    "meta": {
      "jquery-plugin": {
        "deps": [
          "jquery"
        ]
      }
    }
  }
}

Programatically

Call steal.config after steal.js has been loaded like:

steal.config({
  paths: { ... },
  map: { ... }
});

This is is most commonly done in the @config module.

Script Attributes

Any property besides src, id, and type will be used to set on the loader:

<script src="../path/to/steal/steal.js"
        config-path="../path/to/stealconfig.js"
        main="app">
</script>

The above will be translated to a call like:

steal.config({
  configPath: "../path/to/stealconfig.js",
  main: "app"
});

steal object

A steal object loaded before steal.js will be used as a steal.config argument.

<script>
  steal = {
    configPath: "../path/to/stealconfig.js",
    main: "app"
  }
</script>
<script src="../path/to/steal/steal.js"></script>
Help us improve StealJS by taking our community survey