Developing a Custom Component

You can use your preferred JavaScript package manager—either npm or yarn—to install dependencies and manage your project.

Install Previewjs

Preview.js works automatically with Ollie Shop projects created using create-ollie-shop. It reads your project setup and starts without any extra configuration.

Using Preview.js

To use Preview.js in your Ollie Shop project:

  1. Open any component file in your project.
  2. Click the Preview.js icon in your editor, or use the corresponding keyboard shortcut.
  3. A live preview of the component will appear, updating in real time as you make changes.

This integration allows you to develop and test components without setting up a separate environment or manually configuring Preview.js.

Setting the Component ID

After launching the preview:

  • Ensure the Component ID field is populated with the value from meta.json.
  • If it’s empty, copy the ID from meta.json into the field and click the Update button.

Troubleshooting

Still stuck? Report an issue