1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix node-fetch load on renderer

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-09-20 07:24:18 +03:00
parent 53ce818589
commit ef3cc604c3
3 changed files with 4 additions and 40 deletions

View File

@ -31,7 +31,6 @@ import { IpcRendererNavigationEvents } from "../renderer/navigation/events";
import logger from "./logger";
import { productName } from "../common/vars";
import { LensProxy } from "./lens-proxy";
import * as path from "path";
function isHideable(window: BrowserWindow | null): boolean {
return Boolean(window && !window.isDestroyed());
@ -85,7 +84,6 @@ export class WindowManager extends Singleton {
titleBarStyle: "hiddenInset",
backgroundColor: "#1e2124",
webPreferences: {
preload: path.join(__static, "build", "preload.js"),
nodeIntegration: true,
nodeIntegrationInSubFrames: true,
enableRemoteModule: true,

View File

@ -68,41 +68,4 @@ configs.push((): webpack.Configuration => {
};
});
configs.push((): webpack.Configuration => {
console.info("WEBPACK:preload", vars);
return {
context: __dirname,
target: "electron-main",
mode: isProduction ? "production" : "development",
devtool: isProduction ? "source-map" : "cheap-eval-source-map",
cache: isDevelopment,
entry: {
main: path.resolve(preloadEntrypoint),
},
output: {
libraryTarget: "global",
path: buildDir,
filename: "preload.js"
},
resolve: {
extensions: [".json", ".js", ".ts"],
mainFields: ["main"]
},
module: {
rules: [
{
test: /\.node$/,
use: "node-loader"
},
getTSLoader(/\.ts$/)
]
},
plugins: [
new ProgressBarPlugin(),
new ForkTsCheckerPlugin(),
].filter(Boolean)
};
});
export default configs;

View File

@ -77,7 +77,10 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura
extensions: [
".js", ".jsx", ".json",
".ts", ".tsx",
]
],
},
externals: {
"node-fetch": "commonjs node-fetch"
},
optimization: {
minimize: false