How to deploy storybook into a subpath
See original GitHub issueI’d like to be able to deploy storybook into the subpath of /storybook, such that I can target everything related to storybook in an nginx config to use my local domain of “https://test.dev”.
I read that this is possible in the documentation, but couldn’t get it working. If i extend the webpack config like so:
module.exports = (storybookBaseConfig, configType) => {
storybookBaseConfig.output.publicPath = '/storybook/';
// Return the altered config
return storybookBaseConfig;
};
It works for the “manager.bundle.js” and “preview.bundle.js”, but not for “iframe.html” or webpack hot reloading or local css imported via absolute paths.
Is there an easy way to make sure that all requests related to running storybook get prefixed with /storybook?
Alternatively, is there a way to run storybook w/ https via the cli? I can set the host to 'test.dev, but I need it to be https for it to work in dev.
Issue Analytics
- State:
- Created 6 years ago
- Comments:26 (2 by maintainers)
Top Results From Across the Web
Unable to host Storybook on subpath - Stack Overflow
I have a storybook for my react components, and when trying to host the static build of story book at root path (i.e:Â ......
Read more >How to deploy storybook into a subpath #1291 - Issuehunt
I'd like to be able to deploy storybook into the subpath of /storybook, such that I can target everything related to storybook in...
Read more >Publish Storybook
First, we'll need to build Storybook as a static web application. The functionality is already built-in and pre-configured for most supported frameworks. Others ......
Read more >Running Storybook from a separate folder - Darek Kay
When calculating the project root, Storybook first searches for the closest parent .git folder. In my local development environment, this path ...
Read more >Subdirectory Setup - BookStack
By default Apache on Ubuntu serves from the /var/www/html directory. In this example, we'll use /var/www/bookstack to store our BookStack install. If you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve just figured this out finally! 🎉 To set the path prefix you need to set
publicPathin bothwebpackFinalandmanagerWebpackfunctions in the.storybook/main.jslike this:Also, I had to build Storybook with the
preview-urlparameter to make it find the iframe file:For some reason, I have found nothing about it in official docs, had to google it a lot…
the link is broken, can you update it, please?