appName from config.json
This commit is contained in:
4
packages/app/config/default.json
Normal file
4
packages/app/config/default.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"appName": "Snort",
|
||||||
|
"appTitle": "Snort - Nostr"
|
||||||
|
}
|
4
packages/app/config/iris.json
Normal file
4
packages/app/config/iris.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"appName": "iris",
|
||||||
|
"appTitle": "iris"
|
||||||
|
}
|
@ -88,6 +88,7 @@
|
|||||||
"@webpack-cli/generators": "^3.0.4",
|
"@webpack-cli/generators": "^3.0.4",
|
||||||
"@webscopeio/react-textarea-autocomplete": "^4.9.2",
|
"@webscopeio/react-textarea-autocomplete": "^4.9.2",
|
||||||
"babel-loader": "^9.1.3",
|
"babel-loader": "^9.1.3",
|
||||||
|
"config": "^3.3.9",
|
||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
"css-loader": "^6.7.3",
|
"css-loader": "^6.7.3",
|
||||||
"css-minimizer-webpack-plugin": "^5.0.0",
|
"css-minimizer-webpack-plugin": "^5.0.0",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<link rel="preconnect" href="https://imgproxy.snort.social" />
|
<link rel="preconnect" href="https://imgproxy.snort.social" />
|
||||||
<link rel="apple-touch-icon" href="/nostrich_512.png" />
|
<link rel="apple-touch-icon" href="/nostrich_512.png" />
|
||||||
<link rel="manifest" href="/manifest.json" />
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<title>Snort - Nostr</title>
|
<title><%= htmlWebpackPlugin.options.templateParameters.appTitle %></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
@ -4,7 +4,7 @@ const Logo = () => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
return (
|
return (
|
||||||
<h1 className="logo" onClick={() => navigate("/")}>
|
<h1 className="logo" onClick={() => navigate("/")}>
|
||||||
Snort
|
{process.env.APP_NAME}
|
||||||
</h1>
|
</h1>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -209,7 +209,7 @@ function LogoHeader() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Link to="/" className="logo">
|
<Link to="/" className="logo">
|
||||||
<h1>Snort</h1>
|
<h1>{process.env.APP_NAME}</h1>
|
||||||
{currentSubscription && (
|
{currentSubscription && (
|
||||||
<small className="flex">
|
<small className="flex">
|
||||||
<Icon name="diamond" size={10} className="mr5" />
|
<Icon name="diamond" size={10} className="mr5" />
|
||||||
|
@ -9,6 +9,9 @@ const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
|
|||||||
const CopyPlugin = require("copy-webpack-plugin");
|
const CopyPlugin = require("copy-webpack-plugin");
|
||||||
const WorkboxPlugin = require("workbox-webpack-plugin");
|
const WorkboxPlugin = require("workbox-webpack-plugin");
|
||||||
const IntlTsTransformer = require("@formatjs/ts-transformer");
|
const IntlTsTransformer = require("@formatjs/ts-transformer");
|
||||||
|
const { DefinePlugin } = require('webpack');
|
||||||
|
const appConfig = require('config');
|
||||||
|
console.log(`Current config: ${JSON.stringify(appConfig, null, 2)}`);
|
||||||
|
|
||||||
const isProduction = process.env.NODE_ENV == "production";
|
const isProduction = process.env.NODE_ENV == "production";
|
||||||
|
|
||||||
@ -49,6 +52,9 @@ const config = {
|
|||||||
template: "public/index.html",
|
template: "public/index.html",
|
||||||
favicon: "public/favicon.ico",
|
favicon: "public/favicon.ico",
|
||||||
excludeChunks: ["pow", "bench"],
|
excludeChunks: ["pow", "bench"],
|
||||||
|
templateParameters: {
|
||||||
|
appTitle: appConfig.get('appTitle'),
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
filename: "bench.html",
|
filename: "bench.html",
|
||||||
@ -69,6 +75,9 @@ const config = {
|
|||||||
swSrc: "./src/service-worker.ts",
|
swSrc: "./src/service-worker.ts",
|
||||||
})
|
})
|
||||||
: false,
|
: false,
|
||||||
|
new DefinePlugin({
|
||||||
|
"process.env.APP_NAME": JSON.stringify(appConfig.get('appName')),
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
|
10
yarn.lock
10
yarn.lock
@ -2709,6 +2709,7 @@ __metadata:
|
|||||||
"@webpack-cli/generators": ^3.0.4
|
"@webpack-cli/generators": ^3.0.4
|
||||||
"@webscopeio/react-textarea-autocomplete": ^4.9.2
|
"@webscopeio/react-textarea-autocomplete": ^4.9.2
|
||||||
babel-loader: ^9.1.3
|
babel-loader: ^9.1.3
|
||||||
|
config: ^3.3.9
|
||||||
copy-webpack-plugin: ^11.0.0
|
copy-webpack-plugin: ^11.0.0
|
||||||
css-loader: ^6.7.3
|
css-loader: ^6.7.3
|
||||||
css-minimizer-webpack-plugin: ^5.0.0
|
css-minimizer-webpack-plugin: ^5.0.0
|
||||||
@ -5330,6 +5331,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"config@npm:^3.3.9":
|
||||||
|
version: 3.3.9
|
||||||
|
resolution: "config@npm:3.3.9"
|
||||||
|
dependencies:
|
||||||
|
json5: ^2.2.3
|
||||||
|
checksum: 2c29e40be22274462769670a4b69fcbcad2d3049eb15030073e410d32c892ef29e0c879a3d68ef92ddd572c516e4f65a11bb6458f680a44ceb0f051bcd3d97ff
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"connect-history-api-fallback@npm:^2.0.0":
|
"connect-history-api-fallback@npm:^2.0.0":
|
||||||
version: 2.0.0
|
version: 2.0.0
|
||||||
resolution: "connect-history-api-fallback@npm:2.0.0"
|
resolution: "connect-history-api-fallback@npm:2.0.0"
|
||||||
|
Reference in New Issue
Block a user