diff --git a/docs/package.json b/docs/package.json index 39ae2f04221..bc9fe493aca 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,7 +5,8 @@ "scripts": { "clean": "gatsby clean", "develop": "gatsby develop", - "build": "pushd .. && npm install && popd && cross-env NODE_ENV=production gatsby build --prefix-paths" + "build": "pushd .. && npm install && popd && cross-env NODE_ENV=production gatsby build --prefix-paths && npm run build:storybook", + "build:storybook": "cd .. && ./script/build-storybook" }, "engines": { "node": ">= 10.x" diff --git a/script/build-storybook b/script/build-storybook new file mode 100755 index 00000000000..995debd35ae --- /dev/null +++ b/script/build-storybook @@ -0,0 +1,10 @@ +#!/bin/bash + +# Add base url to be able to serve static files +echo '' >> .storybook/manager-head.html + +# Build storybook inside docs +./node_modules/.bin/build-storybook -o docs/public/storybook -s docs/public/static + +# Remove manager-head after build to not interfere with dev builds +rm .storybook/manager-head.html