aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-06-21 02:31:11 +0300
committerGravatar Vitaly Takmazov2023-06-21 02:31:11 +0300
commit3683dcaa362c7d34f05c69990c6c5630f448af94 (patch)
tree63ac55f7ab3eece81ee977dfec1adfae9b190837 /webpack.config.js
parentf8b9f9bdb3af71d36d75a769976b72ddae519001 (diff)
webpack, jest: cleanup eslint warnings
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js26
1 files changed, 12 insertions, 14 deletions
diff --git a/webpack.config.js b/webpack.config.js
index 87483ead..d362c06f 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,12 +1,10 @@
-/* eslint-disable @typescript-eslint/no-var-requires */
-
-const ESLintPlugin = require('eslint-webpack-plugin');
-const MiniCssExtractPlugin = require('mini-css-extract-plugin');
-const TerserPlugin = require('terser-webpack-plugin');
+const ESLintPlugin = require('eslint-webpack-plugin')
+const MiniCssExtractPlugin = require('mini-css-extract-plugin')
+const TerserPlugin = require('terser-webpack-plugin')
module.exports = () => {
- const node_env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
- const dev = node_env !== 'production';
+ const node_env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development'
+ const dev = node_env !== 'production'
const config = {
mode: node_env,
devtool: dev ? 'source-map' : false,
@@ -70,7 +68,7 @@ module.exports = () => {
symlinks: false,
extensions: ['.js']
}
- };
+ }
if (dev) {
config.devServer = {
hot: true,
@@ -80,7 +78,7 @@ module.exports = () => {
runtimeErrors: true
}
}
- };
+ }
config.plugins.push(
new ESLintPlugin({
files: 'src/main/assets',
@@ -88,9 +86,9 @@ module.exports = () => {
failOnWarning: false,
failOnError: true,
fix: false
- }));
+ }))
} else {
- config.plugins.push(new MiniCssExtractPlugin({ filename: 'style.css' }));
+ config.plugins.push(new MiniCssExtractPlugin({ filename: 'style.css' }))
}
config.optimization = {
minimize: !dev,
@@ -102,6 +100,6 @@ module.exports = () => {
terserOptions: {},
}),
]
- };
- return config;
-};
+ }
+ return config
+}