Skip to content

Commit

Permalink
Update storybook config
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpens committed Oct 20, 2023
1 parent b26c765 commit cbc9ab4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions storybook/storybook-docs/config/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import remarkGfm from 'remark-gfm'

const { STORYBOOK_BUILD_PATH } = process.env
const REPO_NAME = 'design-system'

/* eslint-env node */
module.exports = {
core: {
Expand Down Expand Up @@ -35,7 +38,10 @@ module.exports = {
docs: {
autodocs: true,
},
refs: (_, { configType }) => {
refs: (config, { configType }) => {
if (configType === 'PRODUCTION') {
config.base = STORYBOOK_BUILD_PATH ? `/${REPO_NAME}/${STORYBOOK_BUILD_PATH}` : `/${REPO_NAME}`
}
if (configType === 'DEVELOPMENT') {
return {
react: {
Expand All @@ -47,7 +53,7 @@ module.exports = {
return {
react: {
title: 'React.js Components',
url: '../design-system/storybook-react',
url: STORYBOOK_BUILD_PATH ? `../${STORYBOOK_BUILD_PATH}/storybook-react` : `../${REPO_NAME}/storybook-react`,
},
}
},
Expand Down

0 comments on commit cbc9ab4

Please sign in to comment.