This addon makes it easier to work with Storybook 7 and DDEV. It does this by:
- exposing Storybook on port 6006.
- adding a helper command.
Storybook is "a frontend workshop for building UI components".
The addon assumes the developer is correctly installed and configured Storybook using the default port (6006
).
config.storybook.yaml
: exposes the default Storybook port.commands/host/storybook
: Helper command
- Install the addon and restart DDEV.
ddev get tyler36/ddev-storybook
ddev restart
- Install storybook if you haven't already. See the Storybook get started page for instructions. E.g.
ddev exec npx storybook@latest init
The helper function has 2 basic usage:
Use the following command to open Storybook in the default browser.
ddev storybook
Use the following command to start the Storybook server.
ddev storybook -s
Alternatively,
ddev storybook --start
This command will try to run the "storybook" script from package.json
in NPM.
If a yarn.lock
file exists, it will run the command with YARN instead.
This addon was originally created to work with Drupal and storybook contrib module. It has not been tested in other environments, although assuming Storybook defaults, it should work.
PRs, especially with automated tests are welcome.
Contributed and maintained by @tyler36