From 6aec421dc04d0644983dd57a3b8c80622ab0a37e Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" <1474479+chenhunghan@users.noreply.github.com> Date: Fri, 4 Dec 2020 17:36:56 +0800 Subject: [PATCH] Enable persistent cache in renderer/main Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com> --- webpack.main.ts | 8 +++++++- webpack.renderer.ts | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/webpack.main.ts b/webpack.main.ts index a7ea0096df..84c6912bca 100755 --- a/webpack.main.ts +++ b/webpack.main.ts @@ -13,7 +13,13 @@ export default function (): webpack.Configuration { target: "electron-main", mode: isProduction ? "production" : "development", devtool: isProduction ? "source-map" : "eval-source-map", - cache: isDevelopment, + cache: isDevelopment ? { + type: "filesystem", + buildDependencies: { + // Add your config as buildDependency to get cache invalidation on config change + config: [__filename] + } + }: false, entry: { main: path.resolve(mainDir, "index.ts"), }, diff --git a/webpack.renderer.ts b/webpack.renderer.ts index b431ab44fb..981a996613 100755 --- a/webpack.renderer.ts +++ b/webpack.renderer.ts @@ -32,7 +32,13 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura }, name: "lens-app", mode: isProduction ? "production" : "development", - cache: isDevelopment, + cache: isDevelopment ? { + type: "filesystem", + buildDependencies: { + // Add your config as buildDependency to get cache invalidation on config change + config: [__filename] + } + } : false, entry: { [appName]: path.resolve(rendererDir, "bootstrap.tsx"), },