Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(main-app): change main app to esbuild #1678

Merged
merged 5 commits into from
Sep 20, 2022
Merged

Conversation

hyrious
Copy link
Member

@hyrious hyrious commented Sep 6, 2022

#1546 has been outdated too long, so I create a new PR.

Close: #1546

BlackHole1
BlackHole1 previously approved these changes Sep 13, 2022
desktop/main-app/scripts/esbuild/paths.ts Outdated Show resolved Hide resolved
BlackHole1
BlackHole1 previously approved these changes Sep 13, 2022
@BlackHole1
Copy link
Collaborator

Please apply this diff.

diff --git a/desktop/main-app/scripts/esbuild/esbuild.prod.ts b/desktop/main-app/scripts/esbuild/esbuild.prod.ts
index 16669082..30aa44ce 100644
--- a/desktop/main-app/scripts/esbuild/esbuild.prod.ts
+++ b/desktop/main-app/scripts/esbuild/esbuild.prod.ts
@@ -1,5 +1,5 @@
 import esbuild from "esbuild";
-import { dotenvPlugin, external, replaceMetaPlugin } from "./esbuild.common";
+import { dotenvPlugin, external } from "./esbuild.common";
 import * as paths from "./paths";
 
 const buildPreload = esbuild.build({
@@ -9,6 +9,7 @@ const buildPreload = esbuild.build({
     target: "chrome89",
     external: [...external, "electron", "os", "path"],
     outfile: paths.preloadDist,
+    plugins: [dotenvPlugin],
 });
 
 const buildMain = esbuild.build({
@@ -19,7 +20,7 @@ const buildMain = esbuild.build({
     external: [...external, "electron", "electron-devtools-vendor"],
     sourcemap: true,
     outfile: paths.dist,
-    plugins: [dotenvPlugin, replaceMetaPlugin],
+    plugins: [dotenvPlugin],
 });
 
 Promise.all([buildPreload, buildMain]).catch(() => process.exit(1));
diff --git a/desktop/main-app/scripts/esbuild/paths.ts b/desktop/main-app/scripts/esbuild/paths.ts
index 34677b49..3d728c02 100644
--- a/desktop/main-app/scripts/esbuild/paths.ts
+++ b/desktop/main-app/scripts/esbuild/paths.ts
@@ -3,7 +3,7 @@ import path from "path";
 const resolvePath = (...relativePath: string[]): string =>
     path.resolve(__dirname, "..", "..", ...relativePath);
 
-export const dist = resolvePath("dist", "index.js");
+export const dist = resolvePath("dist", "main.js");
 export const preloadDist = resolvePath("dist", "preload.js");
 export const entryFile = resolvePath("src", "index.ts");
 export const preloadPath = resolvePath("src", "preload.ts");

Need rebase main branch

@BlackHole1 BlackHole1 requested a review from a team September 20, 2022 03:47
@BlackHole1 BlackHole1 merged commit 66b2a04 into netless-io:main Sep 20, 2022
@hyrious hyrious deleted the esbuild branch September 20, 2022 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants