entrypoint
const entrypoint: string = $.entrypoint
String value of the entrypoint JavaScript file that was evaluated. It is the
base URL used to resolve relative fetch() / Image / Audio paths.
It is resolved in the following order:
- If a second launch argument (
Switch.argv[1]) was provided (a "bootstrap" launch, where a thin launcher hands the nx.js runtime an app to run):- a
.nropath: its embedded RomFS is mounted and the value is"romfs:/main.js". - any other path (typically a
.jsfile): the value is that path as given.
- a
- Otherwise (a standalone app): if a
main.jsis present in the application's own RomFS, the value is"romfs:/main.js". Failing that, it is the path of the.nroon the SD card with.nroreplaced by.js.
Note: the nx.js runtime's own files (e.g. its source map) are mounted
separately under nxjs: so that romfs: always refers to the running app.
Examples
"romfs:/main.js""sdmc:/switch/my-app.js"