Search code examples
reactjswebpackstorybook

Adding publicPath to Storybook React


We have our Storybook React project in a subpath (http://example.com/storybook) but the production version is looking for assets at the top level (http://example.com/font.woff).

I was reading that you could add a publicPath property or add an override on __webpack_public_path__ but I can't see where to do this?


Solution

  • I had a similar issue with Storybook. Please check the options for build command line. I solved my problem using this link, specially

    build-storybook --static-dir storybook
    

    https://storybook.js.org/docs/configurations/cli-options/