-
Notifications
You must be signed in to change notification settings - Fork 822
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BlackHole1
previously approved these changes
Sep 13, 2022
BlackHole1
previously approved these changes
Sep 13, 2022
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 |
Co-authored-by: hyrious <hyrious@outlook.com>
Co-authored-by: Black-Hole <158blackhole@gmail.com>
ylduang
approved these changes
Sep 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1546 has been outdated too long, so I create a new PR.
Close: #1546