From 7a599f54aba1ad79942ae28ea625433d122f8d3b Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 24 Feb 2025 11:46:12 +0000 Subject: [PATCH] Lint webpack config --- .../simpleserialize.com/webpack.config.js | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/packages/simpleserialize.com/webpack.config.js b/packages/simpleserialize.com/webpack.config.js index 0f2ae396..1095ad4b 100644 --- a/packages/simpleserialize.com/webpack.config.js +++ b/packages/simpleserialize.com/webpack.config.js @@ -1,22 +1,22 @@ -const webpack = require('webpack'); -const { resolve } = require('path'); -const MiniCssExtractPlugin = require('mini-css-extract-plugin') -const HtmlWebpackPlugin = require('html-webpack-plugin'); +const webpack = require("webpack"); +const {resolve} = require("path"); +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); -const isProd = process.env.NODE_ENV === 'production'; +const isProd = process.env.NODE_ENV === "production"; const config = { devtool: "source-map", - mode: isProd ? 'production' : 'development', + mode: isProd ? "production" : "development", entry: { - index: './src/index.tsx', + index: "./src/index.tsx", }, output: { - path: resolve(__dirname, 'dist'), - filename: '[name].js', + path: resolve(__dirname, "dist"), + filename: "[name].js", }, resolve: { - extensions: ['.js', '.jsx', '.ts', '.tsx'], + extensions: [".js", ".jsx", ".ts", ".tsx"], }, module: { rules: [ @@ -27,45 +27,45 @@ const config = { }, }, { - test: /\.scss$/, - use: [ + test: /\.scss$/, + use: [ MiniCssExtractPlugin.loader, { - loader: 'css-loader' + loader: "css-loader", }, { - loader: 'sass-loader', + loader: "sass-loader", options: { sourceMap: true, - } - } - ] - },{ + }, + }, + ], + }, + { test: /\.tsx?$/, - use: 'babel-loader', + use: "babel-loader", exclude: /node_modules/, - } + }, ], }, plugins: [ new webpack.ProvidePlugin({ - process: 'process/browser', - Buffer: ['buffer', 'Buffer'], + process: "process/browser", + Buffer: ["buffer", "Buffer"], }), new MiniCssExtractPlugin({ - filename: 'css/[name].bundle.css' + filename: "css/[name].bundle.css", }), new HtmlWebpackPlugin({ - title: 'Simple Serialize | Chainsafe Systems', - template: 'src/index.html', + title: "Simple Serialize | Chainsafe Systems", + template: "src/index.html", }), ], }; if (isProd) { config.optimization = { - minimizer: [ - ], + minimizer: [], }; } else { config.devServer = { @@ -73,7 +73,7 @@ if (isProd) { open: true, // https://webpack.js.org/configuration/dev-server/#devserveropen hot: true, // https://webpack.js.org/configuration/dev-server/#devserverhot compress: true, // https://webpack.js.org/configuration/dev-server/#devservercompress - stats: 'errors-only', // https://webpack.js.org/configuration/dev-server/#devserverstats- + stats: "errors-only", // https://webpack.js.org/configuration/dev-server/#devserverstats- overlay: true, // https://webpack.js.org/configuration/dev-server/#devserveroverlay }; } @@ -81,14 +81,14 @@ if (isProd) { const workerConfig = { name: "worker", resolve: { - extensions: ['.js', '.jsx', '.ts', '.tsx'], + extensions: [".js", ".jsx", ".ts", ".tsx"], }, entry: { - index: './src/components/worker/index.ts', + index: "./src/components/worker/index.ts", }, output: { - path: resolve(__dirname, 'dist'), - filename: 'worker.js', + path: resolve(__dirname, "dist"), + filename: "worker.js", }, module: { rules: [ @@ -100,21 +100,21 @@ const workerConfig = { }, { test: /worker?$/, - loader: 'threads-webpack-plugin', + loader: "threads-webpack-plugin", }, { test: /\.ts?$/, - use: 'babel-loader', + use: "babel-loader", exclude: /node_modules/, - } + }, ], }, plugins: [ new webpack.ProvidePlugin({ - process: 'process/browser', - Buffer: ['buffer', 'Buffer'], + process: "process/browser", + Buffer: ["buffer", "Buffer"], }), - ] -} + ], +}; module.exports = [config, workerConfig];