- Add a new folder to host your s8 module under the ./app folder
- Copy your default.snapshot.js file to the ./app folder
- Edit the default.snapshot.js file adding the following lines at end
exports.smalltalk = smalltalk;
exports.nil = nil;
Note: Use TextEdit app for editing the snapshot file, because Xcode editor is unusable for big source files.
- Create a package.json file in the ./app folder
- Edit the package.json file to contain
{
"name" : "s8",
"main" : "s8",
"nativescript": {}
}
- Add a require expression to use your image. e.g. in your app.js file you can add
var s8 = require("./s8");
after require("Application"); // to ensure the javascript app is ready to run