diff options
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 +} |