Skip to content

Latest commit

 

History

History
77 lines (55 loc) · 2.35 KB

steal-config.md

File metadata and controls

77 lines (55 loc) · 2.35 KB

@typedef {{}} steal-tools.StealConfig StealConfig @parent steal-tools.types

Configuration values needed for StealJS to load modules. Some set of the following values are required:

@option {String|Array} [main] The module, or modules, that should be imported. This sets [config.main].

  • It is optional if a config is provided.

@option {String} [config] The path to a configuration file. This will also specify baseURL, and sometimes main. This sets [config.configPath].

  • It is optional if main is provided and no other configurations are needed.
  • It is required if you are using NPM.

@option {Object<moduleName,metadata>} [meta] A object of that contain metadata

@option {String} [baseURL] If a configuration file is not used, the [config.baseURL baseURL] value must be set.

@option {Array} [bundle] An array of that should be progressively loaded. See steal's bundle property for more information.

@option {Object<config.jsonOptions>} [jsonOptions] Provides options that can be applied to JSON loading. Using the transform method will run through all JSON files while building, also the package.json's of loaded modules (if using NPM).

@body

Use

[steal-tools.build], [steal-tools.export], and [steal-tools.transformImport] all take a StealConfig, which configures the modules to load.

stealTools.build(StealConfig, ...)
stealTools.pluginifier(StealConfig, ...)
stealTools["export"]({steal: StealConfig, outputs: {...}});

If your config file specifies main, all that is needed is the config location:

stealTools.build({config: __dirname+"/package.json!npm"}, ...)
stealTools.pluginifier({config: __dirname+"/package.json!npm"}, ...)
stealTools.export({
  steal: {config: __dirname+"/package.json!npm"}, 
  outputs: {...}
});

Otherwise, main and config are probably needed:

stealTools.build({
  config: __dirname+"/config.js",
  main: "myproject"
}, ...);

stealTools.pluginifier({
  config: __dirname+"/config.js",
  main: "myproject"
}, ...);

stealTools.export({
  steal: {
    config: __dirname+"/config.js",
    main: "myproject"
  }, 
  outputs: {...}
});

If there is no config, you should specify the baseURL, so StealJS knows where to find your modules.