Skip to content

Commit 830a1e8

Browse files
committed
run production webpack build on postinstall
1 parent ddbd3e2 commit 830a1e8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
"description": "Example of pre-configured SourceJS bundle for building React Component Libraries and Style Guides.",
88
"scripts": {
99
"build-source": "cd ./node_modules/sourcejs && npm run build",
10-
"start": "node ./node_modules/sourcejs/app.js"
10+
"start": "node ./node_modules/sourcejs/app.js",
11+
"postinstall": "node pre-build-production.js"
1112
},
1213
"dependencies": {
1314
"react": "^0.14.2",
1415
"react-dom": "^0.14.2",
15-
"sourcejs": "^0.6.0-nightly.3",
16+
"sourcejs": "^0.6.0-nightly.4",
1617
"sourcejs-react-docgen": "^0.3.0",
17-
"sourcejs-react-styleguidist": "^0.3.0"
18+
"sourcejs-react-styleguidist": "^0.4.0"
1819
}
1920
}

pre-build-production.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Script for pre-building webpack bundle, before running in Heroku and other containers
2+
if (process.env.NODE_ENV === 'production') {
3+
require('sourcejs-react-styleguidist/core/build.js');
4+
}

0 commit comments

Comments
 (0)