Customizing webpackMonitor in nuxt.config.js has no effect

Hellowor1d
10
Hellowor1d
commented a year ago

framework template: nuxt-express

example: nuxt.config.js:

// nuxt.config.js
module.exports = {
...
  webpackMonitor : {
    capture: true, // -> default 'true'
    target: '~/.monitor/stats.json', // default -> '../monitor/stats.json'
    launch: true, // -> default 'false'
    port: 4444, // default -> 8081
    excludeSourceMaps: true // default 'true'
  },
...
}

npx nuxt build --webpackmonitor

then the port was still 8085, and the server of webpack monitor closed automatically itself.

Webpack-Monitor is running on port 8085!
Press ctrl C to exit
Hash: 6b4274d164104b282cf9
Version: webpack 3.10.0
Time: 14708ms
             Asset     Size  Chunks             Chunk Names
server-bundle.json  1.74 MB          [emitted]
  nuxt:build Building done +1m
0
David-Mueller
25
David-Mueller
commented a year ago

Hi there,

try passing the options like this within nuxt.config.js:

  modules: [
    [
      '@nuxtjs/webpackmonitor',
      {
        capture: true, // -> default 'true'
        target: '~.monitor/stats.json', // default -> '../monitor/stats.json'
        launch: true, // -> default 'false'
        port: 4444, // default -> 8081
        excludeSourceMaps: true // default 'true'
      }
    ],
    '@nuxtjs/anothermodule'
  ],

and try setting the analyze build option to keep the nuxt build from terminating via
yarn nuxt build --webpackmonitor --analyze or nuxt.config.js.

Good luck!

0
Informations
Question โ€ข Unresolved
#c2 - Created a year ago