The resources property declares the code and assets that make up your component.
You can only define resources at the root level of your manifest, alongside properties like type and editorElement. The resources property is required, and at minimum, you need client.componentUrl.
When you build with the CLI, it handles resource management automatically: bundling your code, uploading assets, and generating the resource URLs.
The resources object supports the following fields:
Component bundle and assets for the live site.
Component bundle and assets for the editor. Use when your component needs editor-specific behaviors like displaying hover states, showing expanded views, or rendering mock data.
Component bundle for server-side rendering (SSR), improving initial load performance and SEO.
SDK bundle that exposes your component's API to site developers through the $w API for programmatic interaction.
Important: Your server bundle must avoid browser-specific APIs like window and document. If your component relies on these APIs, provide a fallback that renders static content on the server.
The simplest configuration, with only the required client.componentUrl:
A client bundle with a CSS file. The CSS is rendered once per page, regardless of how many instances of the component exist:
Separate bundles for the live site and the editor:
A complete resources object with all supported fields: