diff --git a/packages/app/.storybook/main.ts b/packages/app/.storybook/main.ts index a7e678029..31fee219f 100644 --- a/packages/app/.storybook/main.ts +++ b/packages/app/.storybook/main.ts @@ -16,18 +16,6 @@ const config: StorybookConfig = { name: '@storybook/nextjs', options: {}, }, - webpackFinal: async (config, { configType }) => { - if (configType === 'PRODUCTION') { - return { - ...config, - output: { - ...config.output, - publicPath: '/storybook/', - }, - }; - } - return config; - }, }; export default config; diff --git a/packages/app/package.json b/packages/app/package.json index dc347a501..1c0358625 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -4,12 +4,12 @@ "private": true, "scripts": { "build": "next build", - "build:storybook": "pnpm ts:check && storybook build -o storybook && mv ./storybook ./public", + "build:storybook": "./scripts/build-storybook.sh", "build:preview": "run-s build:storybook build", "dev": "next dev", + "dev:storybook": "storybook dev -p 6006", "lint": "next lint", "start": "next start", - "storybook": "storybook dev -p 6006", "test": "jest --verbose", "ts:check": "tsc --noEmit" }, diff --git a/packages/app/scripts/build-storybook.sh b/packages/app/scripts/build-storybook.sh new file mode 100755 index 000000000..09e41c569 --- /dev/null +++ b/packages/app/scripts/build-storybook.sh @@ -0,0 +1,4 @@ +pnpm ts:check +pnpm storybook build -o storybook +rm -rf ./public/storybook +mv ./storybook ./public