Die Web-App kann per *dotEnv* konfiguriert werden.
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
# Url ohne abschlißenden Slash
|
||||||
|
API_URL= http://localhost:8080
|
||||||
@@ -3,3 +3,4 @@ node_modules
|
|||||||
package-lock.json
|
package-lock.json
|
||||||
yarn.lock
|
yarn.lock
|
||||||
public
|
public
|
||||||
|
/.env
|
||||||
|
|||||||
@@ -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
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user