diff options
author | Vitaly Takmazov | 2023-06-21 02:31:11 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-06-21 02:31:11 +0300 |
commit | 3683dcaa362c7d34f05c69990c6c5630f448af94 (patch) | |
tree | 63ac55f7ab3eece81ee977dfec1adfae9b190837 /webpack.config.js | |
parent | f8b9f9bdb3af71d36d75a769976b72ddae519001 (diff) |
webpack, jest: cleanup eslint warnings
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 26 |
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 +} |