mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-08-02 07:34:33 +02:00
Added the possibility to override partial configs during deployments
Added default output to jest (for terminal output...) Upgraded npm packages. Left jest on 27 because of breaking changes in 28
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
const config = {
|
||||
const defaultConfig = {
|
||||
version: "0.1.0",
|
||||
name: "React-starter-kit",
|
||||
};
|
||||
|
||||
// ignore this :)
|
||||
try {
|
||||
window.config = config;
|
||||
window.defaultConfig = defaultConfig;
|
||||
if (module) {
|
||||
module.exports = config;
|
||||
module.exports = defaultConfig;
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
|
17
public/configOverride.js
Normal file
17
public/configOverride.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* This is the config override file.
|
||||
* This file is meant to be replaced during deployment with override values compared to the regular config.js
|
||||
* For development purposes this file can be completely empty
|
||||
*/
|
||||
|
||||
const configOverride = {};
|
||||
|
||||
// ignore this :)
|
||||
try {
|
||||
window.configOverride = configOverride;
|
||||
if (module) {
|
||||
module.exports = configOverride;
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
@@ -4,7 +4,7 @@
|
||||
},
|
||||
"navBar": {
|
||||
"intro": "Our fancy header with navigation.",
|
||||
"version": "App version:",
|
||||
"version": "version:",
|
||||
"currentDate": "Today's date: {{date, formattedDate}}"
|
||||
},
|
||||
"nav": {
|
||||
|
@@ -4,7 +4,7 @@
|
||||
},
|
||||
"navBar": {
|
||||
"intro": "Een fancy header met navigatie",
|
||||
"version": "Aplicatie versie:",
|
||||
"version": "versie:",
|
||||
"currentDate": "De datum van vandaag: {{date, formattedDate}}"
|
||||
},
|
||||
"nav": {
|
||||
|
@@ -1,18 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/icon/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="description" content="React base project" />
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/icon/apple-icon-180x180.png" />
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<title>React Base App</title>
|
||||
<script src="%PUBLIC_URL%/config.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/icon/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="description" content="React base project" />
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/icon/apple-icon-180x180.png" />
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<title>React Base App</title>
|
||||
<script src="%PUBLIC_URL%/config.js"></script>
|
||||
<script src="%PUBLIC_URL%/configOverride.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user