mvdnbrk / laravel-mix-docs

Laravel Mix Documentation
https://laravel-mix.com/docs
MIT License
15 stars 57 forks source link

TypeError: compiler.plugin is not a function #84

Open amribrahim1 opened 3 years ago

amribrahim1 commented 3 years ago

When I was trying to to use LiveReload, I got error TypeError: compiler.plugin is not a function webpack.mix.js :

const mix = require('laravel-mix');
const LiveReloadPlugin = require('webpack-livereload-plugin');
mix.js('resources/react/app.js', 'public/js')
    .react()
    .sass('resources/sass/app.scss', 'public/css')
    .webpackConfig({
        plugins: [new LiveReloadPlugin()]
    });

The error was because of version 1 in npm install webpack-livereload-plugin@1 --save-dev , like in the documentation. I installed the latest version and got no error npm install webpack-livereload-plugin --save-dev