1
0
mirror of https://github.com/lensapp/lens.git synced 2024-11-28 20:14:22 +03:00

chore: Run lint on webpack/renderer

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-05-05 12:12:39 -04:00
parent 91354eae01
commit 700a9024a8

View File

@ -14,7 +14,14 @@
import CopyPlugin from "copy-webpack-plugin"; import CopyPlugin from "copy-webpack-plugin";
import type { WebpackPluginInstance } from "webpack"; import type { WebpackPluginInstance } from "webpack";
import { DefinePlugin } from "webpack"; import { DefinePlugin } from "webpack";
import { assetsFolderName, isDevelopment, rendererDir, buildDir, htmlTemplate, publicPath } from "./vars"; import {
assetsFolderName,
isDevelopment,
rendererDir,
buildDir,
htmlTemplate,
publicPath,
} from "./vars";
import corePackageJson from "@k8slens/core/package.json"; import corePackageJson from "@k8slens/core/package.json";
const renderer: webpack.Configuration = { const renderer: webpack.Configuration = {
@ -45,15 +52,9 @@
/\[ReactRefreshPlugin] .*?HMR.*? is not enabled/, // enabled in webpack.dev-server /\[ReactRefreshPlugin] .*?HMR.*? is not enabled/, // enabled in webpack.dev-server
], ],
resolve: { resolve: {
extensions: [ extensions: [".js", ".jsx", ".json", ".ts", ".tsx"],
".js", ".jsx", ".json",
".ts", ".tsx",
],
}, },
externals: [ externals: ["npm", "win-ca"],
"npm",
"win-ca"
],
optimization: { optimization: {
minimize: false, minimize: false,
}, },
@ -126,11 +127,7 @@
], ],
}), }),
...( ...(isDevelopment ? [new ReactRefreshWebpackPlugin()] : []),
isDevelopment
? [new ReactRefreshWebpackPlugin()]
: []
),
], ],
}; };
@ -176,10 +173,10 @@
/** /**
* Import CSS or SASS styles with modules support (*.module.scss) * Import CSS or SASS styles with modules support (*.module.scss)
*/ */
export function cssModulesWebpackRule({ styleLoader }: CssModulesWebpackRuleOptions = {}): webpack.RuleSetRule { export function cssModulesWebpackRule({
styleLoader ??= isDevelopment styleLoader,
? "style-loader" }: CssModulesWebpackRuleOptions = {}): webpack.RuleSetRule {
: MiniCssExtractPlugin.loader; styleLoader ??= isDevelopment ? "style-loader" : MiniCssExtractPlugin.loader;
return { return {
test: /\.s?css$/, test: /\.s?css$/,