This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
ScriptCraft/docs/FILE_STRUCTURE.md

17 lines
497 B
Markdown
Raw Normal View History

2020-05-24 18:18:21 +00:00
# File Structure
```
2020-05-24 19:09:14 +00:00
- Jar Root
- scriptcraft/
- Source Root
2020-05-24 18:18:21 +00:00
```
## Recommended Source Structure
```
2020-05-24 19:09:14 +00:00
- Source Root
- ModID/
- index.js/index.ts
- Other Modules
2020-05-24 18:18:21 +00:00
```
### Why is an index file necessary?
Because of the way module resolution in ScriptCraft works, you cannot load a module with ```import 'module-name';``` and no index file. Without an index file you would need to use ```import 'module-name/main';``` to load it and specify ```module-name/main``` as your entry-point.