17 lines
488 B
Markdown
17 lines
488 B
Markdown
|
# File Structure
|
||
|
```
|
||
|
Jar Root/
|
||
|
- scriptcraft
|
||
|
- JS or JSON files
|
||
|
```
|
||
|
|
||
|
## Recommended Source Structure
|
||
|
```
|
||
|
Source Root/
|
||
|
- ModID
|
||
|
- index.js/index.ts
|
||
|
- Other Modules
|
||
|
```
|
||
|
|
||
|
### 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.
|