laravel-mix-docs
laravel-mix-docs copied to clipboard
TypeError: compiler.plugin is not a function
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