Skip to content

Commit b016e5c

Browse files
authored
Merge pull request #9 from ConnectedHomes/GH-8
Add build number to webpack env vars
2 parents 2a55682 + a2f5cb0 commit b016e5c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

packages/react-scripts/config/webpack.config.dev.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ module.exports = {
270270
// if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.
271271
new webpack.DefinePlugin(
272272
Object.assign({}, env.stringified, {
273+
// Currently builds may run in both travis and jenkins env
274+
'process.env.BUILD_NUMBER': JSON.stringify(
275+
process.env.TRAVIS_BUILD_NUMBER || process.env.BUILD_NUMBER || '----'
276+
),
273277
'process.locales': JSON.stringify(locales),
274278
})
275279
),

packages/react-scripts/config/webpack.config.prod.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ module.exports = {
306306
// Otherwise React will be compiled in the very slow development mode.
307307
new webpack.DefinePlugin(
308308
Object.assign({}, env.stringified, {
309+
'process.env.BUILD_NUMBER': JSON.stringify(
310+
process.env.TRAVIS_BUILD_NUMBER || process.env.BUILD_NUMBER || '----'
311+
),
309312
'process.locales': JSON.stringify(locales),
310313
})
311314
),

packages/react-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@connected-home/react-scripts",
3-
"version": "1.0.12",
3+
"version": "1.0.12-1",
44
"description": "Configuration and scripts for Create React App.",
55
"repository": "facebookincubator/create-react-app",
66
"license": "BSD-3-Clause",

0 commit comments

Comments
 (0)