Skip to content

Commit f511dc0

Browse files
committed
Fixes #8 - Adds build number to env vars
1 parent 30c6b39 commit f511dc0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ module.exports = {
266266
// if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.
267267
new webpack.DefinePlugin(
268268
Object.assign({}, env.stringified, {
269+
// Currently builds may run in both travis and jenkins env
270+
'process.env.BUILD_NUMBER': JSON.stringify(
271+
process.env.TRAVIS_BUILD_NUMBER || process.env.BUILD_NUMBER || '----'
272+
),
269273
'process.locales': JSON.stringify(locales),
270274
})
271275
),

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

+3
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ module.exports = {
309309
// Otherwise React will be compiled in the very slow development mode.
310310
new webpack.DefinePlugin(
311311
Object.assign({}, env.stringified, {
312+
'process.env.BUILD_NUMBER': JSON.stringify(
313+
process.env.TRAVIS_BUILD_NUMBER || process.env.BUILD_NUMBER || '----'
314+
),
312315
'process.locales': JSON.stringify(locales),
313316
})
314317
),

0 commit comments

Comments
 (0)