~
tilde
The homeAlias
is a lookup scheme that roots module lookup to your project's base folder, either your steal.directories.lib
folder or the baseURL. It is set to ~
, by default, but can be customized.
The homeAlias
is a lookup scheme that roots module lookup to your project's base folder, either your steal.directories.lib
folder or the baseURL. It is set to ~
, by default, but can be customized.
This syntax is supported by all module formats.
Use
Prepend lookups with
~/
such as:This will load the module from
BASE/components/tabs/tabs.js
. If your package.json has:Then it will be loaded from
BASE/src/components/tabs/tabs.js
.Custom
homeAlias
SymbolYou can change the symbol that's used as the
homeAlias
operator in thesteal
configuration. The following example sets thehomeAlias
to be the@
symbol, instead of~
, for the entire project.Using the above configuration, importing a module relative to the project's home folder is done like this:
Alternatives
The ~ scheme is an alternative to using the package name for look up, such as:
And loading as:
Using ~ provides a shorter alias for your app's package name.
Production
Note that in production you need to use your app's package name in your script tag such as: