Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita854eb2

Browse files
committed
fix issue with dotenv in build
1 parent927f48e commita854eb2

File tree

5 files changed

+39
-49
lines changed

5 files changed

+39
-49
lines changed

‎package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,23 @@
3131
"watch":"tsc -watch -p ./"
3232
},
3333
"dependencies": {
34-
"@types/chokidar":"^2.1.3",
3534
"chokidar":"^3.3.0",
35+
"dotenv":"^8.2.0",
3636
"jsdom":"^15.2.1"
3737
},
3838
"devDependencies": {
3939
"@types/assert":"^1.4.3",
40+
"@types/chokidar":"^2.1.3",
4041
"@types/dotenv":"^8.2.0",
4142
"@types/glob":"^7.1.1",
4243
"@types/jest":"^24.0.25",
4344
"@types/jsdom":"^12.2.4",
4445
"@types/node":"^13.1.6",
4546
"@typescript-eslint/eslint-plugin":"^2.15.0",
4647
"@typescript-eslint/parser":"^2.15.0",
47-
"assert":"^2.0.0",
48-
"concurrently":"^5.0.1",
49-
"dotenv":"^8.2.0",
5048
"eslint":"^6.8.0",
5149
"eslint-config-prettier":"^6.9.0",
5250
"eslint-plugin-prettier":"^3.1.2",
53-
"glob":"^7.1.6",
54-
"graphql":"^14.5.8",
55-
"mocha":"^6.2.2",
5651
"prettier":"^1.19.1",
5752
"ts-jest":"^24.3.0",
5853
"typescript":"^3.7.4",

‎src/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface Environment {
77
}
88

99
constenvironment:Environment={
10-
LOG:(process.env.LOG||'').toLowerCase()==='test',
10+
LOG:(process.env.LOG||'').toLowerCase()==='true',
1111
}
1212

1313
exportdefaultenvironment

‎tsconfig.json

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
{
2-
"compilerOptions": {
3-
"module":"commonjs",
4-
"target":"es2018",
5-
"outDir":"build",
6-
"lib": ["es2018","dom"],
7-
"sourceMap":true,
8-
"rootDir":"src",
9-
"baseUrl":"src",
10-
"strict":true/* enable all strict type-checking options*/,
11-
/* Additional Checks*/
12-
"forceConsistentCasingInFileNames":true,
13-
"noImplicitReturns":true,
14-
"noImplicitThis":true,
15-
"noImplicitAny":true,
16-
"strictNullChecks":true,
17-
"suppressImplicitAnyIndexErrors":true,
18-
"noUnusedLocals":false,
19-
"experimentalDecorators":true,
20-
"emitDecoratorMetadata":true,
21-
"paths": {
22-
"typings": ["../typings/index.d.ts"],
23-
"typings/graphql": ["../typings/graphql.d.ts"],
24-
"@api": ["services/api/index"],
25-
"@gql/*": ["services/api/gql/*"]
26-
},
27-
"allowJs":true
28-
},
29-
"exclude": ["node_modules",".vscode-test","build","resources","web-app","*.js","*.test.ts"]
2+
"compilerOptions": {
3+
"module":"commonjs",
4+
"target":"es2018",
5+
"outDir":"build",
6+
"lib": ["es2018","dom"],
7+
"sourceMap":true,
8+
"rootDir":"src",
9+
"baseUrl":"src",
10+
"strict":true/* enable all strict type-checking options*/,
11+
/* Additional Checks*/
12+
"forceConsistentCasingInFileNames":true,
13+
"noImplicitReturns":true,
14+
"noImplicitThis":true,
15+
"noImplicitAny":true,
16+
"strictNullChecks":true,
17+
"suppressImplicitAnyIndexErrors":true,
18+
"noUnusedLocals":false,
19+
"experimentalDecorators":true,
20+
"emitDecoratorMetadata":true,
21+
"paths": {
22+
"typings": ["../typings/index.d.ts"],
23+
"typings/graphql": ["../typings/graphql.d.ts"]
24+
},
25+
"allowJs":true,
26+
"removeComments":true
27+
},
28+
"exclude": ["node_modules",".vscode-test","build","resources","web-app","*.js","*.test.ts"]
3029
}

‎web-app/src/environment.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
interfaceEnvironment{
2-
GQL_URI:string
3-
DEBUG:boolean
4-
}
5-
61
// validate .env
7-
constrequiredKeys=['REACT_APP_GQL_URI']
8-
for(constrequiredofrequiredKeys){
9-
if(!process.env[required]){
10-
thrownewError(`Missing Environmental Variables:${required}`)
11-
}
12-
}
2+
//const requiredKeys = ['REACT_APP_GQL_URI']
3+
//for (const required of requiredKeys) {
4+
// if (!process.env[required]) {
5+
// throw new Error(`Missing Environmental Variables: ${required}`)
6+
// }
7+
//}
138

14-
exportconstGQL_URI=process.env.REACT_APP_GQL_URI||''
15-
exportconstDEBUG=(process.env.REACT_APP_DEBUG||'').toLowerCase()==='true'
9+
exportconstGQL_URI:string=process.env.REACT_APP_GQL_URI||'https://33mf420q4m.execute-api.us-west-2.amazonaws.com/stage/api-stage'
10+
exportconstDEBUG:boolean=(process.env.REACT_APP_DEBUG||'').toLowerCase()==='true'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp