File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
packages/react/.storybook Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const { DEPLOY_ENV = 'development' } = process . env
4
+
1
5
/**
2
6
* @type {import('@storybook/core-common').StorybookConfig }
3
7
*/
@@ -53,4 +57,16 @@ module.exports = {
53
57
typescript : {
54
58
reactDocgen : 'react-docgen' ,
55
59
} ,
60
+ previewHead : head => {
61
+ if ( DEPLOY_ENV === 'development' ) {
62
+ return head
63
+ }
64
+ return `${ head } \n<meta name="ha-url" content="https://collector.githubapp.com/primer/collect">`
65
+ } ,
66
+ previewBody : body => {
67
+ if ( DEPLOY_ENV === 'development' ) {
68
+ return body
69
+ }
70
+ return `${ body } \n<script src="https://analytics.githubassets.com/hydro-marketing.min.js"></script>`
71
+ } ,
56
72
}
Original file line number Diff line number Diff line change 2
2
set -e
3
3
4
4
if [ -n " $1 " ]; then
5
+ export DEPLOY_ENV=" preview"
5
6
npm run build:preview -w docs
6
7
npm run build:storybook preview
7
8
else
9
+ export DEPLOY_ENV=" production"
8
10
npm run build -w docs
9
11
npm run build:storybook
10
12
fi
You can’t perform that action at this time.
0 commit comments