Skip to content
Advertisement

Control webpack verbosity when programmatically starting vue-cli-service serve

I’m trying to run vue-cli-service serve from inside a Node.js application like this:

JavaScript

And it works.

JavaScript

But when I do it in production mode (change service.init("development") to service.init("production")), I don’t see the webpack “building” progress anymore.

JavaScript

Hence my question: how to start a Vue server in production mode, but keep webpack progress printed to the console?

Advertisement

Answer

Progress is reported by Webpack’s ProgressPlugin, which Vue CLI inserts only for non-production and non-test builds (since 3.x).

You could enable this plugin in <root>/vue.config.js with devServer.progress=true (currently undocumented):

JavaScript

Or in your e2e.js, you could insert the ProgressPlugin into the Service instance’s webpackChainFns[] after init():

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement