[Init] Rework entrypoint file
This commit is contained in:
parent
aff1c83e94
commit
50755b2306
3 changed files with 16 additions and 18 deletions
|
@ -13,7 +13,7 @@ const commit = (await exec("git rev-parse HEAD")).stdout.trim().substring(0, 7)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await build({
|
await build({
|
||||||
entryPoints: ["./entry.js"],
|
entryPoints: ["./src/entry.ts"],
|
||||||
outfile: "./dist/vendetta.js",
|
outfile: "./dist/vendetta.js",
|
||||||
minify: true,
|
minify: true,
|
||||||
bundle: true,
|
bundle: true,
|
||||||
|
|
17
entry.js
17
entry.js
|
@ -1,17 +0,0 @@
|
||||||
// This logs in the native logging implementation, e.g. logcat
|
|
||||||
console.log("Hello from Vendetta!");
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
try {
|
|
||||||
await (await import("./src/index.ts")).default();
|
|
||||||
} catch (ex) {
|
|
||||||
console.log(ex?.stack ?? ex.toString());
|
|
||||||
const dialog = [
|
|
||||||
"Failed to load Vendetta!\n",
|
|
||||||
`Build Number: ${(nativeModuleProxy.InfoDictionaryManager ?? nativeModuleProxy.RTNClientInfoManager).Build}`,
|
|
||||||
`Vendetta: ${__vendettaVersion}`,
|
|
||||||
ex?.stack || ex.toString(),
|
|
||||||
].join("\n");
|
|
||||||
alert(dialog);
|
|
||||||
}
|
|
||||||
})();
|
|
15
src/entry.ts
Normal file
15
src/entry.ts
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import { ClientInfoManager } from "@lib/native";
|
||||||
|
|
||||||
|
// This logs in the native logging implementation, e.g. logcat
|
||||||
|
console.log("Hello from Vendetta!");
|
||||||
|
|
||||||
|
(async () => (await import(".")).default().catch(e => {
|
||||||
|
console.log(e?.stack ?? e.toString());
|
||||||
|
alert([
|
||||||
|
"Failed to load Vendetta!\n",
|
||||||
|
`Build Number: ${ClientInfoManager.Build}`,
|
||||||
|
// @ts-expect-error, replaced in build script
|
||||||
|
`Vendetta: ${__vendettaVersion}`,
|
||||||
|
e?.stack || e.toString(),
|
||||||
|
].join("\n"));
|
||||||
|
}))();
|
Loading…
Reference in a new issue