stormid / scaffold

Project scaffold and UI build system
0 stars 0 forks source link

Update SVG optimisation config #152

Closed mjbp closed 1 month ago

mjbp commented 1 month ago

To prevent viewBox removal:

new ImageMinimizerPlugin({
                minimizer: {
                    implementation: ImageMinimizerPlugin.svgoMinify,
                    options: {
                        encodeOptions: {
                            // Pass over SVGs multiple times to ensure all optimizations are applied. False by default
                            multipass: true,
                            plugins: [{
                                // set of built-in plugins enabled by default
                                // see: https://github.com/svg/svgo#default-preset
                                name: 'preset-default',
                                params: {
                                    overrides: {
                                      removeViewBox: false,
                                    }
                                }
                        }],
                        },
                    },
                },
            })