@@ -16,7 +16,9 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
16
16
const getCSSModuleLocalIdent = require ( 'react-dev-utils/getCSSModuleLocalIdent' ) ;
17
17
const paths = require ( './paths' ) ;
18
18
const modules = require ( './modules' ) ;
19
- const getClientEnvironment = require ( './env' ) ;
19
+ const env = require ( './env' ) ;
20
+ const getClientEnvironment = env . getClientEnvironment ;
21
+ const ccdbApiUrl = env . ccdbApiUrl ;
20
22
const ModuleNotFoundPlugin = require ( 'react-dev-utils/ModuleNotFoundPlugin' ) ;
21
23
22
24
const postcssNormalize = require ( 'postcss-normalize' ) ;
@@ -53,7 +55,7 @@ const shouldUseRelativeAssetPaths = publicPath === './';
53
55
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
54
56
const publicUrl = paths . publicUrlOrPath ;
55
57
// Get environment variables to inject into our app.
56
- const env = getClientEnvironment ( publicUrl ) ;
58
+ const envConfig = getClientEnvironment ( publicUrl ) ;
57
59
// This is the production and development configuration.
58
60
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
59
61
@@ -327,7 +329,7 @@ module.exports = {
327
329
loader : require . resolve ( 'string-replace-loader' ) ,
328
330
options : {
329
331
search : '@@API' ,
330
- replace : '/data-research/consumer-complaints/search/api/v1/' ,
332
+ replace : ccdbApiUrl ,
331
333
flags : 'g'
332
334
}
333
335
}
@@ -483,7 +485,7 @@ module.exports = {
483
485
// In production, it will be an empty string unless you specify "homepage"
484
486
// in `package.json`, in which case it will be the pathname of that URL.
485
487
// In development, this will be an empty string.
486
- new InterpolateHtmlPlugin ( HtmlWebpackPlugin , env . raw ) ,
488
+ new InterpolateHtmlPlugin ( HtmlWebpackPlugin , envConfig . raw ) ,
487
489
// This gives some necessary context to module not found errors, such as
488
490
// the requesting resource.
489
491
new ModuleNotFoundPlugin ( paths . appPath ) ,
@@ -492,7 +494,7 @@ module.exports = {
492
494
// It is absolutely essential that NODE_ENV is set to production
493
495
// during a production build.
494
496
// Otherwise React will be compiled in the very slow development mode.
495
- new webpack . DefinePlugin ( env . stringified ) ,
497
+ new webpack . DefinePlugin ( envConfig . stringified ) ,
496
498
new MiniCssExtractPlugin ( {
497
499
// Options similar to the same options in webpackOptions.output
498
500
// both options are optional
0 commit comments