File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -32,19 +32,22 @@ clean.dependsOn(cleanAll)
32
32
*/
33
33
task bundle (type : YarnTask , dependsOn : yarn_install) {
34
34
environment = [" API_ENV" : mode]
35
- args = [" --API_ENV=${ mode} " , " build" ]
35
+ if (mode == " production" ) {
36
+ args = [" build-prod" ]
37
+ } else {
38
+ args = [" build-dev" ]
39
+ }
36
40
doLast {
37
41
println " Bundled ${ mode} build"
38
- println " NODE_ENV: ${ System.getProperty("API_ENV")} "
39
42
}
40
43
}
41
44
42
45
/**
43
46
* Runs project with yarn start
44
47
*/
45
48
task run (type : YarnTask ) {
46
- environment = [" NODE_ENV " : mode]
47
- args = [' start' ]
49
+ environment = [" API_ENV " : mode]
50
+ args = [" start" , " --API_ENV= ${ mode } " ]
48
51
doLast {
49
52
println " Running ${ mode} build"
50
53
}
Original file line number Diff line number Diff line change 50
50
"web-vitals" : " ^1.0.1"
51
51
},
52
52
"scripts" : {
53
- "start" : " API_ENV=development NODE_ENV=development react-scripts start" ,
54
- "build" : " react-scripts build" ,
53
+ "start" : " react-scripts start" ,
54
+ "build-dev" : " API_ENV=development react-scripts build" ,
55
+ "build-prod" : " API_ENV=production react-scripts build" ,
55
56
"test" : " NODE_ENV=test BABEL_ENV=test react-scripts -r @cypress/instrument-cra start" ,
56
57
"cypress" : " API_ENV=development NODE_ENV=development BABEL_ENV=development cypress open" ,
57
- "watch" : " NODE_ENV=development BABEL_ENV=development webpack --watch"
58
+ "watch" : " NODE_ENV=development BABEL_ENV=development webpack --watch" ,
59
+ "check-env" : " node -e 'console.log(process.env)' | grep API"
58
60
},
59
61
"eslintConfig" : {
60
62
"extends" : [
Original file line number Diff line number Diff line change 1
1
apply plugin : ' base'
2
2
3
- task stage (dependsOn : ' build' )
3
+ task stage (dependsOn : [' clean' , ' build' ])
4
+ build. mustRunAfter clean
You can’t perform that action at this time.
0 commit comments