diff --git a/packages/react/.storybook/main.js b/packages/react/.storybook/main.js index a3cd97ce78b3..aba56f7dffdb 100644 --- a/packages/react/.storybook/main.js +++ b/packages/react/.storybook/main.js @@ -1,3 +1,7 @@ +'use strict' + +const {DEPLOY_ENV = 'development'} = process.env + /** * @type {import('@storybook/core-common').StorybookConfig} */ @@ -53,4 +57,16 @@ module.exports = { typescript: { reactDocgen: 'react-docgen', }, + managerHead: head => { + if (DEPLOY_ENV === 'development') { + return head + } + return `${head}\n` + }, + previewBody: body => { + if (DEPLOY_ENV === 'development') { + return body + } + return `${body}\n` + }, } diff --git a/script/build-docs b/script/build-docs index 24ab7d3c95b0..1361351850aa 100755 --- a/script/build-docs +++ b/script/build-docs @@ -2,9 +2,12 @@ set -e if [ -n "$1" ]; then + # export DEPLOY_ENV="preview" + export DEPLOY_ENV="production" npm run build:preview -w docs npm run build:storybook preview else + export DEPLOY_ENV="production" npm run build -w docs npm run build:storybook fi