diff --git a/assets/static/images/icon-search-map.svg b/assets/static/images/icon-search-map.svg index f3ba44c49..f64e99be0 100644 --- a/assets/static/images/icon-search-map.svg +++ b/assets/static/images/icon-search-map.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/svgo.yml b/assets/svgo.yml deleted file mode 100644 index a21e01278..000000000 --- a/assets/svgo.yml +++ /dev/null @@ -1,5 +0,0 @@ -plugins: - - removeTitle: true - - removeAttrs: - attrs: - - "id" diff --git a/assets/webpack.config.js b/assets/webpack.config.js index c148ad7cc..ef483e132 100644 --- a/assets/webpack.config.js +++ b/assets/webpack.config.js @@ -2,18 +2,18 @@ const path = require("path") const glob = require("glob") const MiniCssExtractPlugin = require("mini-css-extract-plugin") const TerserPlugin = require("terser-webpack-plugin") -const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); +const CssMinimizerPlugin = require("css-minimizer-webpack-plugin") const CopyWebpackPlugin = require("copy-webpack-plugin") module.exports = (env, options) => { const plugins = [ new MiniCssExtractPlugin({ filename: "../css/app.css" }), - new CopyWebpackPlugin({ patterns: [{ from: "static/", to: "../" }] }) + new CopyWebpackPlugin({ patterns: [{ from: "static/", to: "../" }] }), ] - const useMinimization = options.mode === "production"; + const useMinimization = options.mode === "production" - return({ + return { optimization: { minimize: useMinimization, minimizer: [ @@ -21,7 +21,7 @@ module.exports = (env, options) => { new CssMinimizerPlugin(), ], }, - devtool: 'source-map', + devtool: "source-map", entry: { "./js/app.tsx": ["./src/app.tsx"].concat(glob.sync("./vendor/**/*.js")), }, @@ -59,7 +59,28 @@ module.exports = (env, options) => { { loader: "svgo-loader", options: { - externalConfig: "svgo.yml", + plugins: [ + { + name: "preset-default", + params: { + overrides: { + // viewBox is required to resize SVGs with CSS. + // @see https://github.com/svg/svgo/issues/1128 + removeViewBox: false, + }, + }, + }, + { + name: "removeTitle", + active: true, + }, + { + name: "removeAttrs", + params: { + attrs: ["id"], + }, + }, + ], }, }, ], @@ -75,5 +96,5 @@ module.exports = (env, options) => { modules: ["deps", "node_modules"], }, plugins: plugins, - }) + } }