[Init] Assign window object before everything else
This commit is contained in:
parent
276cd18a5b
commit
48138c5b7c
3 changed files with 12 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
||||||
import { build } from "esbuild";
|
import { build } from "esbuild";
|
||||||
import alias from "esbuild-plugin-alias";
|
import alias from "esbuild-plugin-alias";
|
||||||
|
import esg from "esbuild-plugin-external-global";
|
||||||
import fs from "fs/promises";
|
import fs from "fs/promises";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
|
@ -13,9 +14,13 @@ try {
|
||||||
minify: true,
|
minify: true,
|
||||||
bundle: true,
|
bundle: true,
|
||||||
format: "iife",
|
format: "iife",
|
||||||
external: ["react", "react-native"],
|
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
plugins: [alias(aliases)],
|
plugins: [
|
||||||
|
alias(aliases),
|
||||||
|
esg.externalGlobalPlugin({
|
||||||
|
"react": "window.React",
|
||||||
|
})
|
||||||
|
],
|
||||||
legalComments: "external",
|
legalComments: "external",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
"@types/react-native": "^0.70.5",
|
"@types/react-native": "^0.70.5",
|
||||||
"esbuild": "^0.15.11",
|
"esbuild": "^0.15.11",
|
||||||
"esbuild-plugin-alias": "^0.2.1",
|
"esbuild-plugin-alias": "^0.2.1",
|
||||||
|
"esbuild-plugin-external-global": "^1.0.1",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
"typescript": "^4.8.4",
|
"typescript": "^4.8.4",
|
||||||
"zustand": "^4.1.2"
|
"zustand": "^4.1.2"
|
||||||
|
|
|
@ -19,10 +19,6 @@ async function init() {
|
||||||
let erroredOnLoad = false;
|
let erroredOnLoad = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
initSettings();
|
|
||||||
patchAssets();
|
|
||||||
patchLogHook();
|
|
||||||
|
|
||||||
window.vendetta = {
|
window.vendetta = {
|
||||||
patcher: patcher,
|
patcher: patcher,
|
||||||
metro: { ...metro, common: { ...common } },
|
metro: { ...metro, common: { ...common } },
|
||||||
|
@ -48,6 +44,10 @@ async function init() {
|
||||||
},
|
},
|
||||||
logger: logger,
|
logger: logger,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
initSettings();
|
||||||
|
patchAssets();
|
||||||
|
patchLogHook();
|
||||||
} catch (e: Error | any) {
|
} catch (e: Error | any) {
|
||||||
erroredOnLoad = true;
|
erroredOnLoad = true;
|
||||||
alert(`Vendetta failed to initialize...\n${e.stack || e.toString()}`);
|
alert(`Vendetta failed to initialize...\n${e.stack || e.toString()}`);
|
||||||
|
|
Loading…
Reference in a new issue