Packaging Extension
Package and Compile your Extension
Once your extension works under the dev link, you package it into a single file others can install. That file has the extension .rext.
Before you package
Run through this quickly:
extension.jsonis valid, with a sensibleid,versionandapi_version.Your frontend is built (
php artisan d:extensions:watch my-extension --once) sofrontend/distis up to date.Every
modulepath in the manifest points at a file that exists.No path in the package contains
../.You've removed the dev link, or at least you know it's there:
php artisan d:extensions:dev my-extension --unlink.
Build the package
php artisan d:extensions:compileThis packages your extension. The example extension's README passes the extension ID:
php artisan d:extensions:compile my-extensionPassing the ID is the safer habit if you have more than one extension in development. If your panel complains about the argument, drop it.
What's inside a .rext
A .rext is a plain ZIP archive. You can open it with any unzip tool to check what you're shipping. The example's package contains:
backend/routes/client.php
backend/Extension.php
extension.json
frontend/src/dashboard.tsx
frontend/src/dashboardx.tsx
frontend/src/server-route.tsx
frontend/src/dashboard-route.tsx
frontend/dist/dashboard.js
frontend/dist/dashboardx.js
frontend/dist/server-route.js
frontend/dist/dashboard-route.jsTwo things to notice:
extension.jsonsits at the root of the archive, not inside a wrapper folder. If you ever zip an extension by hand, zip the contents of the folder, not the folder itself.Both
srcanddistare included. The compiled JavaScript is what runs; the source travels with it.
List the contents of your own package to confirm:
Test the package like a user would
A package that works under the dev link can still be broken, for example by a missing file. Test the real install path on a clean panel.
The example's README describes the install flow. Copy the .rext into the panel root, then:
(These are the singular spellings from the example README; the docs site's equivalents for the other commands are plural, so check php artisan list | grep extension if one isn't found.)
Then confirm:
php artisan extensions:listshows it, enabled.Your pages appear and your slots render.
Your backend routes respond.
Disabling it (
php artisan extensions:disable my-extension) removes your pages cleanly.
Versioning
Bump version in extension.json every time you cut a new package. Use MAJOR.MINOR.PATCH, as the example's 0.1.0 suggests. A 0.x version tells people the extension is still settling.
Last updated
Was this helpful?

