@laravel-mix/webpack-build-output is the default output for Laravel Mix. It is extracted as a standalone package so you can use it everywhere. For instance with rails/webpacker, symfony/webpack-encore, or in a classic Webpack configuration.
yarn add --dev @laravel-mix/webpack-build-output
npm install -D @laravel-mix/webpack-build-output
pnpm install -D @laravel-mix/webpack-build-output
In your webpack config, add the BuildOutputPlugin
to the plugins list, and change the stats
default settings:
const { BuildOutputPlugin } = require('@laravel-mix/webpack-build-output')
module.exports = {
stats: {
preset: 'errors-warnings',
},
plugins: [
new BuildOutputPlugin(),
],
}
You need to adapt this example depending your webpack configuration or wrapper.
You may customize how built assets are displayed in the table with a handful of options:
new BuildOutputPlugin({
// Clear the console when rendering the table
clearConsole: true,
// Show related assets (when available) in the table
showRelated: true,
// An optional header to print above the table
header: "Laravel Mix v6",
// The desired width of the table
// Defaults to the width of the current terminal window
width: 120,
// The maximum width a table can occupy
// Defaults to `Infinity`
maxWidth: 200,
// Whether or not to print using colors
// Automatically detects color support by default
colors: false,
})
@laravel-mix/webpack-build-output is open-sourced software licensed under the MIT license.