From 35a69e0322fcd271dccadcc2ee8cbb61dcafe62e Mon Sep 17 00:00:00 2001 From: vmishenev Date: Mon, 29 Nov 2021 04:20:31 +0300 Subject: Update npm deps, node (#2251) --- plugins/base/frontend/webpack.config.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'plugins/base/frontend/webpack.config.js') diff --git a/plugins/base/frontend/webpack.config.js b/plugins/base/frontend/webpack.config.js index fe93ed4f..dde701b3 100644 --- a/plugins/base/frontend/webpack.config.js +++ b/plugins/base/frontend/webpack.config.js @@ -2,17 +2,12 @@ const {join, resolve} = require('path'); const ringUiWebpackConfig = require('@jetbrains/ring-ui/webpack.config'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const TerserPlugin = require("terser-webpack-plugin"); const pkgConfig = require('./package.json').config; const componentsPath = join(__dirname, pkgConfig.components); -// Patch @jetbrains/ring-ui svg-sprite-loader config -ringUiWebpackConfig.loaders.svgInlineLoader.include.push( - require('@jetbrains/logos'), - require('@jetbrains/icons') -); - const webpackConfig = () => ({ entry: `${componentsPath}/root.tsx`, resolve: { @@ -53,6 +48,12 @@ const webpackConfig = () => ({ } } ] + }, + { + test: /\.svg$/, + loader: require.resolve('svg-inline-loader'), + options: {removeSVGTagAttrs: false}, + include: [require('@jetbrains/icons')] } ] }, @@ -64,9 +65,15 @@ const webpackConfig = () => ({ chunkFilename: '[id].css', }), ], + optimization: { + minimize: true, + minimizer: [new TerserPlugin({ + extractComments: false, + })], + }, output: { path: __dirname + '/dist/' } }); -module.exports = webpackConfig; +module.exports = webpackConfig; \ No newline at end of file -- cgit