Skip to content

Commit 04d7b93

Browse files
committed
fixed build script
1 parent 595c16a commit 04d7b93

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

frontend/build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,22 @@ clean.dependsOn(cleanAll)
3232
*/
3333
task bundle(type: YarnTask, dependsOn: yarn_install) {
3434
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+
}
3640
doLast {
3741
println "Bundled ${mode} build"
38-
println "NODE_ENV: ${System.getProperty("API_ENV")}"
3942
}
4043
}
4144

4245
/**
4346
* Runs project with yarn start
4447
*/
4548
task run(type: YarnTask) {
46-
environment = ["NODE_ENV": mode]
47-
args = ['start']
49+
environment = ["API_ENV": mode]
50+
args = ["start", "--API_ENV=${mode}"]
4851
doLast {
4952
println "Running ${mode} build"
5053
}

frontend/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@
5050
"web-vitals": "^1.0.1"
5151
},
5252
"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",
5556
"test": "NODE_ENV=test BABEL_ENV=test react-scripts -r @cypress/instrument-cra start",
5657
"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"
5860
},
5961
"eslintConfig": {
6062
"extends": [

gradle/heroku/stage.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
apply plugin: 'base'
22

3-
task stage(dependsOn: 'build')
3+
task stage(dependsOn: ['clean', 'build'])
4+
build.mustRunAfter clean

0 commit comments

Comments
 (0)