Page MenuHomePhabricator

D7371.id24897.diff
No OneTemporary

D7371.id24897.diff

diff --git a/lib/webpack/shared.cjs b/lib/webpack/shared.cjs
--- a/lib/webpack/shared.cjs
+++ b/lib/webpack/shared.cjs
@@ -107,7 +107,7 @@
return { alchemyKey, walletConnectKey };
}
-async function createProdBrowserConfig(baseConfig, babelConfig) {
+async function createProdBrowserConfig(baseConfig, babelConfig, envVars) {
const browserConfig = createBaseBrowserConfig(baseConfig);
const babelRule = getBrowserBabelRule(babelConfig);
const { alchemyKey, walletConnectKey } = await getConfigs();
@@ -122,6 +122,7 @@
BROWSER: true,
COMM_ALCHEMY_KEY: JSON.stringify(alchemyKey),
COMM_WALLETCONNECT_KEY: JSON.stringify(walletConnectKey),
+ ...envVars,
},
}),
new MiniCssExtractPlugin({
@@ -175,7 +176,7 @@
};
}
-async function createDevBrowserConfig(baseConfig, babelConfig) {
+async function createDevBrowserConfig(baseConfig, babelConfig, envVars) {
const browserConfig = createBaseBrowserConfig(baseConfig);
const babelRule = getBrowserBabelRule(babelConfig);
const { alchemyKey, walletConnectKey } = await getConfigs();
@@ -190,6 +191,7 @@
BROWSER: true,
COMM_ALCHEMY_KEY: JSON.stringify(alchemyKey),
COMM_WALLETCONNECT_KEY: JSON.stringify(walletConnectKey),
+ ...envVars,
},
}),
new ReactRefreshWebpackPlugin(),
diff --git a/web/webpack.config.cjs b/web/webpack.config.cjs
--- a/web/webpack.config.cjs
+++ b/web/webpack.config.cjs
@@ -11,6 +11,14 @@
const babelConfig = require('./babel.config.cjs');
+async function getConfig(configName) {
+ const { getCommConfig } = await import(
+ // eslint-disable-next-line monorepo/no-relative-import
+ '../keyserver/dist/lib/utils/comm-config.js'
+ );
+ return await getCommConfig(configName);
+}
+
const baseBrowserConfig = {
entry: {
browser: ['./script.js'],
@@ -159,9 +167,16 @@
];
module.exports = async function (env) {
+ const identityServiceConfig = await getConfig({
+ folder: 'secrets',
+ name: 'identity_service_config',
+ });
+ const envVars = {
+ IDENTITY_SERVICE_CONFIG: JSON.stringify(identityServiceConfig),
+ };
const browserConfigPromise = env.prod
- ? createProdBrowserConfig(baseProdBrowserConfig, babelConfig)
- : createDevBrowserConfig(baseDevBrowserConfig, babelConfig);
+ ? createProdBrowserConfig(baseProdBrowserConfig, babelConfig, envVars)
+ : createDevBrowserConfig(baseDevBrowserConfig, babelConfig, envVars);
const nodeConfigPromise = createNodeServerRenderingConfig(
baseNodeServerRenderingConfig,
babelConfig,

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 1:27 PM (9 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2709502
Default Alt Text
D7371.id24897.diff (2 KB)

Event Timeline