TheBrokenRail
e80e229efb
Some checks failed
ScriptCraft/pipeline/head There was a failure building this commit
50 lines
796 B
Markdown
50 lines
796 B
Markdown
# Module Resolution
|
|
All ScriptCraft mods have a folder called ```scriptcraft``` in the root of their JAR file, when ScriptCraft is loaded all of these are combined to form a single "virtual" root. It is recommended to use namespaces to avoid conflicts with other mods.
|
|
|
|
## Examples
|
|
|
|
### Relative
|
|
Test Code:
|
|
```javascript
|
|
import '../path';
|
|
```
|
|
|
|
Test Code Path:
|
|
```
|
|
/some/thing/index.js
|
|
```
|
|
|
|
Module Resolution trace:
|
|
```
|
|
/some/path
|
|
/some/path.js
|
|
/some/path.json
|
|
/some/path.mjs
|
|
/some/path/index
|
|
/some/path/index.js
|
|
/some/path/index.json
|
|
/some/path/index.mjs
|
|
```
|
|
|
|
### Non-Relative
|
|
Test Code:
|
|
```javascript
|
|
import 'path';
|
|
```
|
|
|
|
Test Code Path:
|
|
```
|
|
/some/thing/index.js
|
|
```
|
|
|
|
Module Resolution trace:
|
|
```
|
|
/path
|
|
/path.js
|
|
/path.json
|
|
/path.mjs
|
|
/path/index
|
|
/path/index.js
|
|
/path/index.json
|
|
/path/index.mjs
|
|
``` |