Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/react/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
'use strict'

const {DEPLOY_ENV = 'development'} = process.env

/**
* @type {import('@storybook/core-common').StorybookConfig}
*/
Expand Down Expand Up @@ -53,4 +57,16 @@ module.exports = {
typescript: {
reactDocgen: 'react-docgen',
},
previewHead: head => {
if (DEPLOY_ENV === 'development') {
return head
}
return `${head}\n<meta name="ha-url" content="https://collector.githubapp.com/primer/collect">`
},
previewBody: body => {
if (DEPLOY_ENV === 'development') {
return body
}
return `${body}\n<script src="https://analytics.githubassets.com/hydro-marketing.min.js"></script>`
},
}
2 changes: 2 additions & 0 deletions script/build-docs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
set -e

if [ -n "$1" ]; then
export DEPLOY_ENV="preview"
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