diff --git a/webpack/renderer.ts b/webpack/renderer.ts index 126a0e25cfc2..da8f28577929 100755 --- a/webpack/renderer.ts +++ b/webpack/renderer.ts @@ -13,7 +13,7 @@ import CircularDependencyPlugin from "circular-dependency-plugin"; import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin"; import type { WebpackPluginInstance } from "webpack"; import getTypescriptLoader from "./get-typescript-loader"; -import { assetsFolderName, isDevelopment, rendererDir, buildDir, appName, htmlTemplate, publicPath, sassCommonVars, ignoreIf } from "./vars"; +import { assetsFolderName, isDevelopment, rendererDir, buildDir, appName, htmlTemplate, publicPath, sassCommonVars } from "./vars"; export function webpackLensRenderer({ showVars = true } = {}): webpack.Configuration { if (showVars) { @@ -115,9 +115,11 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura filename: "[name].css", }), - ...ignoreIf(isDevelopment, [ - new ReactRefreshWebpackPlugin(), - ]), + ...( + isDevelopment + ? [] + : [new ReactRefreshWebpackPlugin()] + ), ], }; } diff --git a/webpack/vars.ts b/webpack/vars.ts index d4737fd9ef0b..478b04459d16 100644 --- a/webpack/vars.ts +++ b/webpack/vars.ts @@ -19,9 +19,3 @@ export const appName = isDevelopment export const htmlTemplate = path.resolve(rendererDir, "template.html"); export const publicPath = "/build/"; export const sassCommonVars = path.resolve(rendererDir, "components/vars.scss"); - -export function ignoreIf(check: boolean, src: T[]): T[] { - return check - ? [] - : src; -}