ExportOutput
- typedef
Specifies the behavior for an output in an ExportObject "outputs" property. These properties are in addition to TransformOptions.
Object
Properties
-
modules
{Array<moduleName | comparitor>}
OptionalBuilds all the modules in
modules
together with their dependencies. -
eachModule
{Array<moduleName | comparitor>}
OptionalBuilds each module in the list with its dependendencies individually. Use this if you want to create separate builds for more than one module in your graph:
stealTools.export({ steal: { config: __dirname + "/package.json!npm" } });
-
graphs
{Array<moduleName | comparitor>}
OptionalBuilds each item in the graph on its own. Each dependency is built individually.
-
dest
{String | function(moduleName, moduleData, load, loader)}
Specifies where the output should be written. Dest can be provided as a string or a function that returns the location.
-
moduleName
{String | Array<String>}
The module name or module names being written out by this output.
-
moduleData
{Object | Array<Object>}
Deprecated.
-
load
{Load | Array<Load>}
The module load record, or module load records, being written by this output.
-
loader
{Loader}
The Steal loader used by Steal to load all of these modules. All configuration should be available on it.
-
-
ignore
{Array<moduleName | ignorer()>}
OptionalModules that should be ignored and not included in the output.
You can use it like:
stealTools.export({ steal: { config: __dirname + "/package.json!npm" }, options: {}, outputs: { "+global-js": { ignore: [ "jquery" ] } } })
Or alternatively you can provide an ignorer function that will be called with each moduleName, giving you the opportunity to programmatically determine if a module should be ignored.
stealTools.export({ steal: { config: __dirname + "/package.json!npm" }, options: {}, outputs: { "+global-js": { ignore: [function(name){ if(name.indexOf("foobar") >= 0) { return true; } else { return false; } }] } } })
For the [steal-tools/lib/build/helpers/global] helper providing
false
(instead of an Array) for this option will not ignore modules defined innode_modules
as is done by default.
Use
Only one of
modules
,eachModule
, orgraphs
can be specified.modules
All modules specified by
modules
and their dependencies will be built together. For example:This will build "foo" and "bar" together in the global format. If "foo", or "bar" depend on "zed", "zed" will also be included.
eachModule
Each module specified by
eachModule
will be exported, including its dependencies individually. For example:eachModule is useful when you want to take a dependency graph and split it into separate builds that will be combined around certain modules within that graph.
For example:
This will build out
dist/global/app/a.js
anddist/global/app/b.js
, both as standalone builds.graphs
Each module specified by
graphs
and its dependencies will be exported individually. For example:This will export "foo" to a file, and each of its dependencies to their own file. This will also export "bar" to a file, and each of its dependencies to their own file. If "foo" and "bar" both depend on "zed", "zed" will be written to its own file one time.
dest
Dest should specify a single file, typically with a string, if
modules
is provided, like:Otherwise, a folder or function should be provided, if using
eachModule or
graphs`: