diff --git a/src/main/SentryClient.ts b/src/main/SentryClient.ts
index 0751078c..d2349af8 100644
--- a/src/main/SentryClient.ts
+++ b/src/main/SentryClient.ts
@@ -16,8 +16,9 @@ export class SentryClient {
let dsn;
try {
- const extraResourcesPath =
- process.env.NODE_ENV === 'production' ? path.join(process.resourcesPath, 'extraResources') : 'extraResources';
+ const extraResourcesPath = import.meta.env.PROD
+ ? path.join(process.resourcesPath, 'extraResources')
+ : 'extraResources';
dsn = fs.readFileSync(path.join(extraResourcesPath, '.sentrydsn'), { encoding: 'utf-8' });
} catch (e) {
diff --git a/src/main/index.ts b/src/main/index.ts
index ca756162..a37f094b 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -122,7 +122,7 @@ function initializeApp() {
mainWindow.center();
- if (process.env.NODE_ENV === 'development') {
+ if (import.meta.env.DEV) {
mainWindow.webContents.openDevTools();
}
@@ -137,7 +137,7 @@ function initializeApp() {
return { action: 'deny' };
});
- if (process.env.NODE_ENV === 'development') {
+ if (import.meta.env.DEV) {
// Open the DevTools.
settings.openInEditor();
mainWindow.webContents.once('dom-ready', () => {
@@ -213,7 +213,7 @@ function initializeApp() {
app.on('ready', () => {
createWindow();
- if (process.env.NODE_ENV === 'development') {
+ if (import.meta.env.DEV) {
installExtension(REACT_DEVELOPER_TOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));
diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts
index f4051a5e..a0888d8d 100644
--- a/src/react-app-env.d.ts
+++ b/src/react-app-env.d.ts
@@ -1,6 +1,7 @@
-//
{packageInfo.version}
|diff --git a/tsconfig.json b/tsconfig.json index b31ac9ea..c28841db 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "allowJs": true, - "module": "commonjs", + "module": "ESNext", "skipLibCheck": true, "esModuleInterop": true, "noImplicitAny": true,