Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terser Plugin issue while building with webpack-cli #504

Open
dannycoulombe opened this issue May 4, 2022 · 3 comments
Open

Terser Plugin issue while building with webpack-cli #504

dannycoulombe opened this issue May 4, 2022 · 3 comments

Comments

@dannycoulombe
Copy link

dannycoulombe commented May 4, 2022

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.

@rishu605
Copy link

I'm facing this issue with webpack-cli

When I run npm run build, the above issue comes up.

I'm using webpack 5.75.0
offline-plugin 5.0.7
terser-webpack-plugin 5.3.6

@secit-pl
Copy link

secit-pl commented Dec 13, 2022

The same here, but in Symfony (webpack-encore in all versions above 1.0.0).

The problem is that the offline-plugin is not compatible with terser-webpack-plugin in version 5

@brandoncollins7
Copy link

Any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants