question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to hide webpack output result table ?

See original GitHub issue
  • Laravel Mix Version: 6.0.6
  • Node Version: 14.15.4
  • NPM Version: 6.13.7
  • Webpack Version: 5.11.1
  • cross-env Version: 7.0.3
  • OS: Windows 10

Hi,

When i build for production with the command below, i have the webpack results in a table. npm run production Where script is: cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --config=node_modules/laravel-mix/setup/webpack.config.js

How could i hide the table below and just show β€œCompiled Successfully in xxxx ms”

   Laravel Mix v6.0.6   
                        

βœ” Compiled Successfully in 13063ms
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ File                              β”‚ Size     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ fonts/vendor/@fortawesome/fontaw… β”‚ 896 KiB  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ fonts/vendor/@fortawesome/fontaw… β”‚ 730 KiB  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ /js/app.js                        β”‚ 310 KiB  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ css/app.css                       β”‚ 290 KiB  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
................................

Thanks for you help

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:14

github_iconTop GitHub Comments

10reactions
pabuecocommented, Mar 29, 2021

I had the same issue when using a package that copied a few hundred images to the public folder. Mix would just print every single file on every compilation. I invested some time since it was really annoying.

Turns out you can simply add an event hook and overwrite the assets object.

mix.after((stats) => {
  stats.compilation.assets = {}
})

This however prevents mix from displaying any files at all. If you only want to remove unimportant files like images you can just do this.

mix.after((stats) => {
  const assets = { ...stats.compilation.assets }
  stats.compilation.assets = {}

  for (const [path, asset] of Object.entries(assets)) {
    if (path.endsWith('.js')) {
      stats.compilation.assets[path] = asset
    }
  }
})

Since you get the whole target path of the asset you can also filter them based on their destination folder or use a regex to apply a more complex filter logic.

7reactions
tocsacommented, Oct 13, 2021

Please create an option to supress it, we really need that. Just upgraded to version 6, and this too talkative output just make nearly unreadable our CI/CD outputs for multiple instances.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to hide webpack output result table ? #2764 - GitHub
When i build for production with the command below, i have the webpack results in a table. npm run production. Where script is:...
Read more >
Output - webpack
The top-level output key contains a set of options instructing webpack on how and where it should output your bundles, assets, and anything...
Read more >
Webpack: silence output - Stack Overflow
Basically, it's this module that produces the output. The output by default mostly contains list of assets, and list of modules. You can...
Read more >
webpack-dev-server - npm
Start using webpack-dev-server in your project by running `npm i ... Table of Contents ... --no-stats Disable stats output.
Read more >
Configuration - Nuxt
Luckily you can run nuxt webpack command from withing your project to output the configuration. Checkout this PR #7029 for more details. Add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found