For all the other types of extensions we have folders in the extensions folder(for example there are hooks and endpoints folders, but no bundles folder), which I am mounting as a volume inside the directus container. There is one more difference between bundle extensions and the other extension types, which is bundle extensions have two bundles, app.js and api.js(app is for displays, interfaces, layouts, modules, operations, panels and api is for endpoints, hooks, operations). Where do we put those two js bundles ?
#✅ Extensions bundle in Directus docker image
14 messages · Page 1 of 1 (latest)
Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please make sure your question includes the following:
- An explanation of exactly what you're trying to achieve.
- Any and all related code or previous attempts.
- The exact issue or error you are facing.
- Any screenshots if applicable.
When you're done with this thread, please close it.
(If you have a support agreement and need help, please contact the core team via email.)
✅ Extensions bundle in Directus docker image
This post is now closed. If you want or need to continue this topic, just send another message and it will be unarchived.
Unarchive since still not solved.
Directly in your extensions folder as “directus-extension-NAME-bundle” as long as it’s prefixed with “directus-extension-“ and ends with “-bundle” it will find it
@gusty acorn this a place to improve Docs?
ending with -bundle is not required. but you do need a package.json for bundles
When I build the bundle extensions I get only app.js and api.js as output. There is no package.json. Directus still cannot load the bundle extensions.
unlike the single extensions you need these files:
directus-extension-your-extension/
- package.json
- dist/
- app.js
- api.js
the package.json is used to determine the type of extension and where the dist/* ended up in the directus:extension section
when developing you can use your entire extension including source if you like
Okay I see now. I've changed the path for app and api under directus:extension, so that when I build the bundle the output lands directly inside the extensions folder. I will leave the output configuration as is, but how do I "move" the output of the bundle build to the extensions folder ?
any way that works for your setup, as long as it ends up in the extensions folder 😬 copy-pasting, symlinking, npm linking, mounting it in docker volume
Thank you very much for clarifying this for me(hopefully for others in similar situation as well). Closing thread now.