[Vuejs]-Mode in project building in vue js

4👍

Your file setup seem correct, it looks like you need to change your command from this:

npm run build --mode production

to this

npm run build -- --mode production

According to this github thread: https://github.com/vuejs/vue-cli/issues/1528#issuecomment-395970443

Copying the comment there:

“In other words: all arguments before — are interpreted as arguments for npm itself, not the script you are running.”


Alternatively, if you don’t use the npm script shortcut, you can use vue-cli-service directly:

vue-cli-service build --mode production
👤d-_-b

Leave a comment