I created a new Alloy project and followed the example from Getting Started with Alloy // Pebble Developers
i.e. I added a new file math.js in the same folder as main.js with the content
export function add(a, b) {
return a + b;
}
export function multiply(a, b) {
return a * b;
}
and replaced the code in main.js with
import { add, multiply } from "./math";
console.log("Sum: " + add(2, 3)); // 5
console.log("Product: " + multiply(4, 5)); // 20
It compiled and installed successfully, but the log shows the following problem:
$ pebble logs --emulator emery
[19:31:24] xsHost.c:155> Found mod "pebble.moddable.tech"
[19:31:24] xsRun.c:408> Exception SyntaxError: import add not found
How can I make it work?