diff options
author | 2022-11-22 16:35:42 +0100 | |
---|---|---|
committer | 2022-11-22 16:40:04 +0100 | |
commit | 862cb00e40aa6f094aff019a44f52ebfca90ab88 (patch) | |
tree | 3c32b6ca6612d07d3d1fcfc5620c86ba9c774b3b /subprojects/frontend/vite.config.ts | |
parent | refactor(language): simplify syntax (diff) | |
download | refinery-862cb00e40aa6f094aff019a44f52ebfca90ab88.tar.gz refinery-862cb00e40aa6f094aff019a44f52ebfca90ab88.tar.zst refinery-862cb00e40aa6f094aff019a44f52ebfca90ab88.zip |
fix(frontend): mobx 6.7.0 typing
Also bumps some dependencies and updates tsconfig.json
The added workarounds should be remove once
https://github.com/mobxjs/mobx/issues/3582 is resolved.
Diffstat (limited to 'subprojects/frontend/vite.config.ts')
-rw-r--r-- | subprojects/frontend/vite.config.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/subprojects/frontend/vite.config.ts b/subprojects/frontend/vite.config.ts index 526ea541..2c810912 100644 --- a/subprojects/frontend/vite.config.ts +++ b/subprojects/frontend/vite.config.ts | |||
@@ -14,29 +14,29 @@ setDefaultResultOrder('verbatim'); | |||
14 | 14 | ||
15 | const thisDir = path.dirname(fileURLToPath(import.meta.url)); | 15 | const thisDir = path.dirname(fileURLToPath(import.meta.url)); |
16 | 16 | ||
17 | const mode = process.env.MODE || 'development'; | 17 | const mode = process.env['MODE'] || 'development'; |
18 | const isDevelopment = mode === 'development'; | 18 | const isDevelopment = mode === 'development'; |
19 | process.env.NODE_ENV ??= mode; | 19 | process.env['NODE_ENV'] ??= mode; |
20 | 20 | ||
21 | function portNumberOrElse(envName: string, fallback: number): number { | 21 | function portNumberOrElse(envName: string, fallback: number): number { |
22 | const value = process.env[envName]; | 22 | const value = process.env[envName]; |
23 | return value ? parseInt(value, 10) : fallback; | 23 | return value ? parseInt(value, 10) : fallback; |
24 | } | 24 | } |
25 | 25 | ||
26 | const listenHost = process.env.LISTEN_HOST || 'localhost'; | 26 | const listenHost = process.env['LISTEN_HOST'] || 'localhost'; |
27 | const listenPort = portNumberOrElse('LISTEN_PORT', 1313); | 27 | const listenPort = portNumberOrElse('LISTEN_PORT', 1313); |
28 | const apiHost = process.env.API_HOST || '127.0.0.1'; | 28 | const apiHost = process.env['API_HOST'] || '127.0.0.1'; |
29 | const apiPort = portNumberOrElse('API_PORT', 1312); | 29 | const apiPort = portNumberOrElse('API_PORT', 1312); |
30 | const apiSecure = apiPort === 443; | 30 | const apiSecure = apiPort === 443; |
31 | const publicHost = process.env.PUBLIC_HOST || listenHost; | 31 | const publicHost = process.env['PUBLIC_HOST'] || listenHost; |
32 | const publicPort = portNumberOrElse('PUBLIC_PORT', listenPort); | 32 | const publicPort = portNumberOrElse('PUBLIC_PORT', listenPort); |
33 | const publicSecure = publicPort === 443; | 33 | const publicSecure = publicPort === 443; |
34 | 34 | ||
35 | const { name: packageName, version: packageVersion } = JSON.parse( | 35 | const { name: packageName, version: packageVersion } = JSON.parse( |
36 | readFileSync(path.join(thisDir, 'package.json'), 'utf8'), | 36 | readFileSync(path.join(thisDir, 'package.json'), 'utf8'), |
37 | ) as { name: string; version: string }; | 37 | ) as { name: string; version: string }; |
38 | process.env.VITE_PACKAGE_NAME ??= packageName; | 38 | process.env['VITE_PACKAGE_NAME'] ??= packageName; |
39 | process.env.VITE_PACKAGE_VERSION ??= packageVersion; | 39 | process.env['VITE_PACKAGE_VERSION'] ??= packageVersion; |
40 | 40 | ||
41 | const minifyPlugin: PluginOption = { | 41 | const minifyPlugin: PluginOption = { |
42 | name: 'minify-html', | 42 | name: 'minify-html', |