Die Web-App kann per *dotEnv* konfiguriert werden.

This commit is contained in:
2021-04-09 18:19:42 +02:00
parent 365c2f041c
commit 7f8a50799f
4 changed files with 7 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
# Url ohne abschlißenden Slash
API_URL= http://localhost:8080
+1
View File
@@ -3,3 +3,4 @@ node_modules
package-lock.json package-lock.json
yarn.lock yarn.lock
public public
/.env
+1
View File
@@ -19,6 +19,7 @@
"@rollup/plugin-commonjs": "^15.0.0", "@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-node-resolve": "^9.0.0", "@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.0", "@rollup/plugin-replace": "^2.3.0",
"dotenv": "^8.2.0",
"npm-run-all": "^4.1.3", "npm-run-all": "^4.1.3",
"rollup": "^2.30.0", "rollup": "^2.30.0",
"rollup-plugin-svelte": "^6.0.0", "rollup-plugin-svelte": "^6.0.0",
+3 -1
View File
@@ -3,6 +3,7 @@ import replace from '@rollup/plugin-replace';
import resolve from '@rollup/plugin-node-resolve'; import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs'; import commonjs from '@rollup/plugin-commonjs';
import { terser } from 'rollup-plugin-terser'; import { terser } from 'rollup-plugin-terser';
import {config} from 'dotenv';
const production = !process.env.ROLLUP_WATCH; const production = !process.env.ROLLUP_WATCH;
@@ -35,7 +36,8 @@ export default {
commonjs(), commonjs(),
replace({ replace({
'process.env.NODE_ENV': JSON.stringify(production ? 'production' : 'development') 'process.env.NODE_ENV': JSON.stringify(production ? 'production' : 'development'),
'env': JSON.stringify({...config().parsed /* attached the .env config*/})
}), }),
// If we're building for production (npm run build // If we're building for production (npm run build