Skip to content

Terser Plugin issue while building with webpack-cli #504

Open
@dannycoulombe

Description

Whenever I try to build this project, using laravel-mix 6.0.6, I get the following error:

[webpack-cli] Invalid options object. Terser Plugin has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'minimizer'. These properties are valid:
   object { test?, include?, exclude?, terserOptions?, extractComments?, parallel?, minify? }

My webpack config is pretty straightforward:

.webpackConfig({
        devtool: 'source-map',
        plugins: [
            new webpack.DefinePlugin({
                'process.env': {
                    API_URL: JSON.stringify(process.env.API_URL),
                },
            }),
            new OfflinePlugin({
                appShell: '/',
                autoUpdate: 1000 * 60 * 60, // one hour
                externals: [
                    '/',
                ]
            }),
        ],
        devServer: {
            port: 8079,
        },
        resolve: {
            alias: {
                '@': path.resolve('resources/app')
            }
        }
    })

I am importing OfflinePlugin this way:

const OfflinePlugin = require('@lcdp/offline-plugin');

Anybody experiencing the same issue? I tried to downgrade to multiple versions without any success. I am now on version 5.0.7.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions