Skip to content

Commit

Permalink
remove ignoreIf from webpack/vars.ts
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Malton <sebastian@malton.name>
  • Loading branch information
Nokel81 committed Apr 1, 2022
1 parent 39caa99 commit 4410311
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 6 additions & 4 deletions webpack/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -115,9 +115,11 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura
filename: "[name].css",
}),

...ignoreIf(isDevelopment, [
new ReactRefreshWebpackPlugin(),
]),
...(
isDevelopment
? []
: [new ReactRefreshWebpackPlugin()]
),
],
};
}
Expand Down
6 changes: 0 additions & 6 deletions webpack/vars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(check: boolean, src: T[]): T[] {
return check
? []
: src;
}

0 comments on commit 4410311

Please sign in to comment.