Skip to content

Add build number to webpack env vars #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2017
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
4 changes: 4 additions & 0 deletions packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ module.exports = {
// if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.
new webpack.DefinePlugin(
Object.assign({}, env.stringified, {
// Currently builds may run in both travis and jenkins env
'process.env.BUILD_NUMBER': JSON.stringify(
process.env.TRAVIS_BUILD_NUMBER || process.env.BUILD_NUMBER || '----'
),
'process.locales': JSON.stringify(locales),
})
),
Expand Down
3 changes: 3 additions & 0 deletions packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ module.exports = {
// Otherwise React will be compiled in the very slow development mode.
new webpack.DefinePlugin(
Object.assign({}, env.stringified, {
'process.env.BUILD_NUMBER': JSON.stringify(
process.env.TRAVIS_BUILD_NUMBER || process.env.BUILD_NUMBER || '----'
),
'process.locales': JSON.stringify(locales),
})
),
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connected-home/react-scripts",
"version": "1.0.12",
"version": "1.0.12-1",
"description": "Configuration and scripts for Create React App.",
"repository": "facebookincubator/create-react-app",
"license": "BSD-3-Clause",
Expand Down