• page

Installing StealJS stealjs.installing

 

Learn how to install StealJS.

Basic Install

By default, StealJS is designed to work from the same folder as your scripts, typically a public folder. Install StealJS in a public folder by:

If you downloaded or cloned steal, you might have run:

> ./js steal/make.js

When finished you should have the following in a public folder:

steal/
stealconfig.js
js
js.bat

Note: StealJS requires Java 1.6 or greater.

To verify that steal works, run one of the following commands in the folder you installed StealJS:

mac > ./js

windows > js

The folder you installed steal is the ROOT folder.

Installing Steal other places

It's possible, using steal.config, to locate steal other places. It's common to want steal in a folder that is maintained by a server-side dependency management system like Maven or NPM.

The following shows StealJS and CanJS placed in a shared folder while application code exists in the apps folder.

public/
   shared/
      can/
      steal/
      js
      js.bat
      stealconfig.js
   apps/
      app/
         app.js
         app.html

To make it possible for app.js to use steal and be built by it, the following needs to happen:

app.html

Have app.html point to shared/steal/steal.js like:

<script src="../../shared/steal/steal.js?app">

stealconfig.js

Update the paths to the can and steal folders and set steal root to be the public folder:

root: steal.config('root').join('../apps'),
paths: {
  "can/": "../shared/can/",
  "steal/" : "../shared/steal/",
}

Notice that:

  • steal.config('root').join('../apps') updates the root path relative to the default root location.
  • The paths to can and steal are given relative to the root folder.