From 83b620fded335d03e94074891b02929a9ea19f16 Mon Sep 17 00:00:00 2001 From: muji Date: Mon, 12 Feb 2024 13:06:41 +0800 Subject: [PATCH] Tidy webpack config. --- lib/server-url.ts | 3 ++- package.json | 1 - snap.manifest.json | 2 +- webpack.config.js | 14 +------------- yarn.lock | 42 ++---------------------------------------- 5 files changed, 6 insertions(+), 56 deletions(-) diff --git a/lib/server-url.ts b/lib/server-url.ts index d0ee66a..099dc17 100644 --- a/lib/server-url.ts +++ b/lib/server-url.ts @@ -1 +1,2 @@ -export default process.env.RELAY_URL || `http://localhost:7007`; +//export default process.env.RELAY_URL || `http://localhost:7007`; +export default process.env.RELAY_URL || `https://relay.tss.ac`; diff --git a/package.json b/package.json index 37f70a3..1b7589b 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "parcel": "^2.11.0", "postcss": "^8.4.35", "prettier": "^3.2.5", - "string-replace-loader": "^3.1.0", "tailwindcss": "^3.4.1", "ts-loader": "^9.5.1", "tsconfig-paths-webpack-plugin": "^4.1.0", diff --git a/snap.manifest.json b/snap.manifest.json index 684dce4..78aa0b5 100644 --- a/snap.manifest.json +++ b/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/mpc-sdk/multi-factor-accounts" }, "source": { - "shasum": "HIDM3Ke0P0bhvfyVUwigS7MP+Z5pYs8NYWtaTAreqMA=", + "shasum": "6nxvY4hB/YhIuocnhpmrgKlJTAPw6buOcKPFRe89VPs=", "location": { "npm": { "filePath": "bundle/bundle.js", diff --git a/webpack.config.js b/webpack.config.js index 0ada217..bcb2517 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,10 +7,6 @@ const dotenv = require("dotenv"); const envFile = process.env.NODE_ENV ? `.env.${process.env.NODE_ENV}` : ".env"; dotenv.config({ path: envFile }); -const isProduction = process.env.NODE_ENV === "production"; -const url = isProduction - ? "${document.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${location.host}" - : "ws://${location.hostname}:7007"; module.exports = { entry: "./app/index.tsx", module: { @@ -20,14 +16,6 @@ module.exports = { use: "ts-loader", exclude: /node_modules/, }, - { - test: /server-url\.ts?$/, - loader: "string-replace-loader", - options: { - search: "ws://localhost:7007", - replace: url, - }, - }, ], }, resolve: { @@ -49,7 +37,7 @@ module.exports = { patterns: ["index.html", "dist/styles.css", "favicon.png"], }), new webpack.DefinePlugin({ - "process.env.RELAY_URL": JSON.stringify("https://relay.tss.ac"), + "process.env.RELAY_URL": JSON.stringify(process.env.RELAY_URL), "process.env.SNAP_ID": JSON.stringify(process.env.SNAP_ID), }), ], diff --git a/yarn.lock b/yarn.lock index d224e50..25b66de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2356,7 +2356,6 @@ __metadata: react-dom: "npm:^18.2.0" react-hook-form: "npm:^7.50.1" react-router-dom: "npm:^6.22.0" - string-replace-loader: "npm:^3.1.0" tailwind-merge: "npm:^2.2.1" tailwindcss: "npm:^3.4.1" tailwindcss-animate: "npm:^1.0.7" @@ -5518,13 +5517,6 @@ __metadata: languageName: node linkType: hard -"big.js@npm:^5.2.2": - version: 5.2.2 - resolution: "big.js@npm:5.2.2" - checksum: 230520f1ff920b2d2ce3e372d77a33faa4fa60d802fe01ca4ffbc321ee06023fe9a741ac02793ee778040a16b7e497f7d60c504d1c402b8fdab6f03bb785a25f - languageName: node - linkType: hard - "binary-extensions@npm:^2.0.0": version: 2.2.0 resolution: "binary-extensions@npm:2.2.0" @@ -6973,13 +6965,6 @@ __metadata: languageName: node linkType: hard -"emojis-list@npm:^3.0.0": - version: 3.0.0 - resolution: "emojis-list@npm:3.0.0" - checksum: 7dc4394b7b910444910ad64b812392159a21e1a7ecc637c775a440227dcb4f80eff7fe61f4453a7d7603fa23d23d30cc93fe9e4b5ed985b88d6441cd4a35117b - languageName: node - linkType: hard - "encodeurl@npm:~1.0.2": version: 1.0.2 resolution: "encodeurl@npm:1.0.2" @@ -9065,7 +9050,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.1.2, json5@npm:^2.2.0, json5@npm:^2.2.1, json5@npm:^2.2.2, json5@npm:^2.2.3": +"json5@npm:^2.2.0, json5@npm:^2.2.1, json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -9364,17 +9349,6 @@ __metadata: languageName: node linkType: hard -"loader-utils@npm:^2.0.0": - version: 2.0.4 - resolution: "loader-utils@npm:2.0.4" - dependencies: - big.js: "npm:^5.2.2" - emojis-list: "npm:^3.0.0" - json5: "npm:^2.1.2" - checksum: d5654a77f9d339ec2a03d88221a5a695f337bf71eb8dea031b3223420bb818964ba8ed0069145c19b095f6c8b8fd386e602a3fc7ca987042bd8bb1dcc90d7100 - languageName: node - linkType: hard - "locate-path@npm:^5.0.0": version: 5.0.0 resolution: "locate-path@npm:5.0.0" @@ -11420,7 +11394,7 @@ __metadata: languageName: node linkType: hard -"schema-utils@npm:^3.0.0, schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": +"schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": version: 3.3.0 resolution: "schema-utils@npm:3.3.0" dependencies: @@ -11916,18 +11890,6 @@ __metadata: languageName: node linkType: hard -"string-replace-loader@npm:^3.1.0": - version: 3.1.0 - resolution: "string-replace-loader@npm:3.1.0" - dependencies: - loader-utils: "npm:^2.0.0" - schema-utils: "npm:^3.0.0" - peerDependencies: - webpack: ^5 - checksum: b2b5df0961d1902c0d6cf39b1ed046c99e31c0e1af1d336eee78264bb440d4a61c6ac23094e8365d272ac82411dbbfc2d6fbbf4f84b7eac21c4f63272a5d615e - languageName: node - linkType: hard - "string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3"