How to include webpack plugins when using Laravel Mix?

Mix’s API provides a useful webpackConfig method for adjusting the webpack config. https://laravel.com/docs/5.6/mix#custom-webpack-configuration The webpackConfig method accepts an object, which should contain any Webpack-specific configuration that you wish to apply. I believe the following code should work. webpack.mix.js: const mix = require(‘laravel-mix’); const CompressionPlugin = require(‘compression-webpack-plugin’); mix.setPublicPath(‘dist’) .js(‘src/app.js’, ‘scripts/’) .extract([ ‘jquery’, ‘axios’, ‘babel-polyfill’, ‘lodash’, ‘tether’, … Read more

Laravel Mix unknown option ‘–hide-modules’ error

Update Laravel Mix npm install –save-dev laravel-mix@latest Update Your NPM Scripts If your build throws an error such as Unknown argument: –hide-modules, the scripts section of your package.json file will need to be updated. The Webpack 5 CLI removed a number of options that your NPM scripts was likely referencing. While you’re at it, go … Read more

Enable inline javascript in LESS

I had same problem, I use webpack with less loader, I needed to add javascript option in less loader config: { test: /\.less$/, use: [{ loader: “style-loader” }, { loader: “css-loader” }, { loader: “less-loader”, options: { javascriptEnabled: true } }] } I found in the sourcecode of less compiler: https://github.com/less/less.js/blob/3.x/bin/lessc that they parse js … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)