Skip to content

Commit

Permalink
fixed metamask's dependency issue. Is caused by extra instance of rea…
Browse files Browse the repository at this point in the history
…ct being injected by metamask sdk, causing redux to fail. Also fixed .env to be platform agnostic
  • Loading branch information
jeryongchan committed Jan 19, 2024
1 parent 800903b commit 04656fc
Show file tree
Hide file tree
Showing 12 changed files with 31,015 additions and 17 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PORT = 1212

# MQ_URL=amqp://localhost:5672
TASK_EXECUTOR_URL=http://localhost:2591
# TASK_EXECUTOR_URL=http://172.18.0.255:2591

REGISTRATION_SERVICE_API_URL=http://sbip-g2.d2.comp.nus.edu.sg:11000/fn-discovery
DID_VERIFIER_SERVICE_API_URL=http://sbip-g2.d2.comp.nus.edu.sg:11000/did-verifier
Expand Down
26 changes: 22 additions & 4 deletions .erb/configs/webpack.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ import webpackPaths from './webpack.paths';
import { dependencies as externals } from '../../release/app/package.json';
import path from 'path';


// Load .env file
const env = dotenv.config().parsed;

console.log("process.platform", process.platform)
// Determine TASK_EXECUTOR_URL based on the OS
// const TASK_EXECUTOR_URL = process.platform === "win32"
// ? "http://localhost:2591"
// : "http://172.18.0.255:2591";

const IPV4_ADDRESS = process.platform === "win32" ? "173.18.0.255" : "172.18.0.255"
console.log("IPV4_ADDRESS", IPV4_ADDRESS)
// Merge custom environment variables
const environmentVariables = {
...env, // Existing .env variables
// TASK_EXECUTOR_URL, // Add TASK_EXECUTOR_URL
IPV4_ADDRESS,
NODE_ENV: 'production', // You can keep or remove this line depending on your setup
};


const configuration: webpack.Configuration = {
externals: [...Object.keys(externals || {})],

Expand Down Expand Up @@ -65,10 +86,7 @@ const configuration: webpack.Configuration = {
},

plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
...dotenv.config().parsed,
}),
new webpack.EnvironmentPlugin(environmentVariables),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
Expand Down
Loading

0 comments on commit 04656fc

Please sign in to comment.