Skip to content

Commit 95c61dd

Browse files
committed
Allow custom build path via .env config
1 parent c0f9302 commit 95c61dd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/react-scripts/config/paths.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ var path = require('path');
1414
var fs = require('fs');
1515
var url = require('url');
1616

17-
// ZEAL: Allow custom build paths via .env config.
18-
var buildPath = process.env.BUILD_PATH || 'build'
17+
// ZEAL: Allow custom build path via .env config.
18+
var buildPath = process.env.BUILD_PATH || 'build';
1919

2020
// Make sure any symlinks in the project folder are resolved:
2121
// https://github.com/facebookincubator/create-react-app/issues/637
@@ -79,7 +79,7 @@ function getServedPath(appPackageJson) {
7979
// config after eject: we're in ./config/
8080
// ZEAL: use `client` instead of `src` for app directory
8181
module.exports = {
82-
appBuild: resolveApp('build'),
82+
appBuild: resolveApp(buildPath),
8383
appPublic: resolveApp('client/public'),
8484
appHtml: resolveApp('client/public/index.html'),
8585
appIndexJs: resolveApp('client/index.js'),
@@ -101,7 +101,7 @@ function resolveOwn(relativePath) {
101101
// config before eject: we're in ./node_modules/react-scripts/config/
102102
// ZEAL: use `client` instead of `src` for app directory
103103
module.exports = {
104-
appPath: resolveApp('.'),
104+
appPath: resolveApp(buildPath),
105105
appBuild: resolveApp('build'),
106106
appPublic: resolveApp('client/public'),
107107
appHtml: resolveApp('client/public/index.html'),
@@ -128,7 +128,7 @@ if (!reactScriptsLinked && __dirname.indexOf(path.join('packages', 'react-script
128128
// ZEAL: use `client` instead of `src` for app directory
129129
module.exports = {
130130
appPath: resolveApp('.'),
131-
appBuild: resolveOwn('../../build'),
131+
appBuild: resolveOwn('../../' + buildPath),
132132
appPublic: resolveOwn('template/client/public'),
133133
appHtml: resolveOwn('template/client/public/index.html'),
134134
appIndexJs: resolveOwn('template/client/index.js'),

0 commit comments

Comments
 (0)