5

Is there a way to change the default minifier that Laravel Mix uses?

By default, it uses 'Terser' (the Webpack default), but I would like it to instead use Closure Compiler (see here).

I have tried various things but have not had any luck yet. This is my latest failed attempt:

mix.webpackConfig({
    module: {
        rules: [
            // ...
        ]
    },
    plugins: [
        // ...
    ],
    resolve: {
        alias: {
            // ...
        }
    },
    optimization: {
        minimizer: [
            new ClosurePlugin({mode: 'STANDARD'}, {})
        ]
    }
});

I would like to specifically achieve this using the webpack.mix.js configuration if possible i.e. I would like to avoid overriding the Laravel mix configuration (this may not be possible)

Ben Carey
  • 16,540
  • 19
  • 87
  • 169

0 Answers0