Now that you’ve checked out a project, you have a directory with your project’s code. Let’s get to know what’s there.
yourProject/
├── src/
│ ├── js/
│ │ ├── app.js
│ │ ├── intro.js
│ │ └── extResources.json
│ ├── config/
│ │ └── playerOptions.json
│ ├── _eko_/
└── package.json
src
The src directory contains your code. This is where the JavaScript modules you write should be saved. You can organize your code in any subdirectories structure under the src/ directory.
Eko supports es6 import/export statements and we highly recommend you organize your code in this fashion. You can also refer to our examples section for some reference.
When you start your project this folder will contain four important files:
src/js/app.jsis the main entrypoint of your code.src/js/intro.jscan be used to tune advanced loading flows.src/config/playerOptions.jsonholds the player configuration.src/js/extResources.jsonis used to declare external resources for the project.
Please see JavaScript Entrypoints for details about the structure of
app.jsandintro.js.
package.json
Your project has its own package.json. You can use this to add external libraries to your code.
Note that this file can also be overwritten by Eko Studio when packages are added via the Studio Code Panel.
_eko_
The src/_eko_/ directory contains auto-generated files created by Eko Studio.
Do not edit files in the
_eko_directory. Changes made to files in this directory will be overridden by Eko Studio.