aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/frontend/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/frontend/webpack.config.js')
-rw-r--r--plugins/base/frontend/webpack.config.js21
1 files changed, 14 insertions, 7 deletions
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