mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Setting up environment prop
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
f7bcad0717
commit
0105c66c9f
@ -26,7 +26,7 @@ import * as Mobx from "mobx";
|
|||||||
import * as LensExtensionsCommonApi from "../extensions/common-api";
|
import * as LensExtensionsCommonApi from "../extensions/common-api";
|
||||||
import * as LensExtensionsMainApi from "../extensions/main-api";
|
import * as LensExtensionsMainApi from "../extensions/main-api";
|
||||||
import { app, autoUpdater, dialog, powerMonitor } from "electron";
|
import { app, autoUpdater, dialog, powerMonitor } from "electron";
|
||||||
import { appName, isMac, productName, dsn } from "../common/vars";
|
import { appName, isMac, productName, dsn, isProduction } from "../common/vars";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { LensProxy } from "./proxy/lens-proxy";
|
import { LensProxy } from "./proxy/lens-proxy";
|
||||||
import { WindowManager } from "./window-manager";
|
import { WindowManager } from "./window-manager";
|
||||||
@ -62,12 +62,7 @@ import { FilesystemProvisionerStore } from "./extension-filesystem";
|
|||||||
import { CaptureConsole, Dedupe, Offline } from "@sentry/integrations";
|
import { CaptureConsole, Dedupe, Offline } from "@sentry/integrations";
|
||||||
|
|
||||||
// Initializing Sentry
|
// Initializing Sentry
|
||||||
const Sentry =
|
const Sentry = require("@sentry/electron/dist/main");
|
||||||
// prevent `TypeError: mod.require is not a function`
|
|
||||||
// see https://docs.sentry.io/platforms/javascript/guides/electron/#webpack-configuration
|
|
||||||
process.type === "main"
|
|
||||||
? require("@sentry/electron/dist/main")
|
|
||||||
: require("@sentry/electron/dist/renderer");
|
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn,
|
dsn,
|
||||||
@ -82,7 +77,8 @@ Sentry.init({
|
|||||||
"rocess.env.NODE_ENV": process.env.NODE_ENV,
|
"rocess.env.NODE_ENV": process.env.NODE_ENV,
|
||||||
"process.env.CICD": process.env.CICD
|
"process.env.CICD": process.env.CICD
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
environment: isProduction ? "production" : "development"
|
||||||
});
|
});
|
||||||
|
|
||||||
const workingDir = path.join(app.getPath("appData"), appName);
|
const workingDir = path.join(app.getPath("appData"), appName);
|
||||||
|
|||||||
@ -36,16 +36,11 @@ import { registerIpcHandlers } from "./ipc";
|
|||||||
import { ipcRenderer } from "electron";
|
import { ipcRenderer } from "electron";
|
||||||
import { IpcRendererNavigationEvents } from "./navigation/events";
|
import { IpcRendererNavigationEvents } from "./navigation/events";
|
||||||
import { catalogEntityRegistry } from "./api/catalog-entity-registry";
|
import { catalogEntityRegistry } from "./api/catalog-entity-registry";
|
||||||
import { dsn } from "../common/vars";
|
import { dsn, isProduction } from "../common/vars";
|
||||||
import { CaptureConsole, Dedupe, Offline } from "@sentry/integrations";
|
import { CaptureConsole, Dedupe, Offline } from "@sentry/integrations";
|
||||||
|
|
||||||
// Initializing Sentry
|
// Initializing Sentry
|
||||||
const Sentry =
|
const Sentry = require("@sentry/electron/dist/renderer");
|
||||||
// prevent `TypeError: mod.require is not a function`
|
|
||||||
// see https://docs.sentry.io/platforms/javascript/guides/electron/#webpack-configuration
|
|
||||||
process.type === "main"
|
|
||||||
? require("@sentry/electron/dist/main")
|
|
||||||
: require("@sentry/electron/dist/renderer");
|
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn,
|
dsn,
|
||||||
@ -60,7 +55,8 @@ Sentry.init({
|
|||||||
"rocess.env.NODE_ENV": process.env.NODE_ENV,
|
"rocess.env.NODE_ENV": process.env.NODE_ENV,
|
||||||
"process.env.CICD": process.env.CICD
|
"process.env.CICD": process.env.CICD
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
environment: isProduction ? "production" : "development"
|
||||||
});
|
});
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import webpack from "webpack";
|
import type webpack from "webpack";
|
||||||
import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin";
|
import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin";
|
||||||
import { isProduction, mainDir, buildDir, isDevelopment } from "./src/common/vars";
|
import { isProduction, mainDir, buildDir, isDevelopment } from "./src/common/vars";
|
||||||
import nodeExternals from "webpack-node-externals";
|
import nodeExternals from "webpack-node-externals";
|
||||||
@ -62,9 +62,6 @@ export default function (): webpack.Configuration {
|
|||||||
plugins: [
|
plugins: [
|
||||||
new ProgressBarPlugin(),
|
new ProgressBarPlugin(),
|
||||||
new ForkTsCheckerPlugin(),
|
new ForkTsCheckerPlugin(),
|
||||||
new webpack.DefinePlugin({
|
|
||||||
"process.type": '"main"',
|
|
||||||
}),
|
|
||||||
].filter(Boolean)
|
].filter(Boolean)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -174,11 +174,6 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura
|
|||||||
|
|
||||||
isDevelopment && new webpack.HotModuleReplacementPlugin(),
|
isDevelopment && new webpack.HotModuleReplacementPlugin(),
|
||||||
isDevelopment && new ReactRefreshWebpackPlugin(),
|
isDevelopment && new ReactRefreshWebpackPlugin(),
|
||||||
|
|
||||||
new webpack.DefinePlugin({
|
|
||||||
"process.type": '"renderer"',
|
|
||||||
}),
|
|
||||||
|
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user