App Bundle
An AppBundle
is an entity that is used when hosting an app on Contentful.
There are two ways to create an AppBundle
:
- You can upload a bundle directly in your app settings by dragging and dropping the files into the drop zone.
This will automatically upload them and create a new
AppBundle
right after. After saving, the uploaded assets will be served when your app is used. - With the CLI command.
Each AppBundle
belongs to an AppDefinition
. Although there can be more than one AppBundle
for each AppDefintion
,
only one AppBundle
can be active at a time. The active bundle is referenced directly by the AppDefinition
and is served when the app is rendered.
You can also activate a previous AppBundle
either via the user interface by selecting it from the list of previous bundles, or
also via a CLI command
Limitations
There are some limitations to keep in mind when creating an AppBundle
:
- Every
AppBundle
needs a validindex.html
file at the root level of the folder. - There is a limit of 10mb and a maximum of 500 files for each bundle.
- All internal links to your assets must use relative paths. Absolute paths will not work because the public URL is randomly generated. If you're using Vite, adding
base: ''
orbase: './'
to yourvite.config.js
will resolve this. If you're on an earlier version of acreate-contentful-app
bootstrap, adding"homepage": "."
to yourpackage.json
will resolve this.