main
config.main
{Array<String>}
The entry point of the application.
main="packageName/main"
Loads an entry point by referencing it in association with the [config.packageName] of your application.
<script src="node_modules/steal/steal.js"
main="todo-app/app"></script>
Parameters
-
packageName
{String}
The name of the package from the package.json
name
field. -
main
{String}
The name of the entry module (usually a JavaScript file).
main="~/main"
Loads an entry point by referencing in association with the homeAlias.
<script src="node_modules/steal/steal.js"
main="~/app"></script>
Parameters
-
main
{String}
The name of the entry module (usually a JavaScript file).
{ main: "packageName/main" }
Loads an entry point by referencing the main in a configuration setting (such as within steal-tools). Any tool which takes a steal configuration object can accept a main, for example:
const stealTools = require("steal-tools");
stealTools.build({
config: __dirname + "/package.json!npm",
main: "todo-app/app"
});
This method can also be used to configure steal within HTML, by setting the main prior to the steal script tag like so:
<script>
steal = {
baseURL: "/apps/todos",
main: "~/main"
};
</script>
<script src="node_modules/steal/steal.js"></script>
Omitting the main
The main module is not loaded by default. Merely adding a steal script tag will not load any code:
This is particular useful for demo pages where there isn't an associated JavaScript file for that particular page, and code is written inline using a steal-module script tag tag:
Missing main warning
This warning is reported to the console when steal starts and no other modules are loaded. This is usually a mistake as you wouldn't be using steal if you didn't intend to load modules with it. It could be that:
main
attribute in the steal script tag. See the above signatures for how to do that.steal uses a heuristic to determine if this warning should be shown. If you believe the warning is shown by mistake please submit an issue.