A well-organized project is the foundation for maintainability and scalability. A Sliprail extension project has a standard structure, with the manifest.json file at its core.
A typical extension project looks like this:
my-extension/
├── main.mjs # The main entry point for the extension
├── manifest.json # The extension manifest file
├── icon.svg # (Optional) The extension's icon
├── node_modules/ # Project dependencies
├── package.json # Project metadata and scripts
└── README.md # (Optional) Extension documentation
manifest.json FileThe manifest.json file defines how your extension integrates with the Sliprail system. It contains key information such as its unique identifier, icon, and main entry point.
Here is a simple example of a manifest.json:
{
"id": "your-extension-id",
"icon": "icon.svg",
"main": "main.mjs"
}
Sliprail does not automatically run npm install for extensions. This means that if your extension uses npm packages, you must bundle all dependencies with your code.
node_modules into your final output files.This approach ensures that extensions have a consistent and reliable runtime environment on any user's system.