How to run `ionic build` in development mode?


I am using Ionic Framework v5 with Vuejs (created with ionic start).

It builds in production mode, but I want to build in development mode.

I build with ionic build, and it outputs:

> vue-cli-service build

⠴  Building for production...

When I run vue-cli-service directly – I get the same output.

When I run vue-cli-service build --mode development – it builds in development mode.

I tried ionic build --mode development, but it still builds in production mode.

I tried various additional configuration changes, but couldn’t get ionic build to build in development.

  1. How can this be done?
  2. When building in production mode – the code gets minified. How can I skip the minification?

UPDATE: I get the same results when I try to run it with ionic build -lcs:

user@ubuntu:~/project (master)$ ionic build -lcs
> vue-cli-service build

⠼  Building for production...Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
⠦  Building for production...


I’m using Ionic 6 instead of 5 but running the below command as shared in this answer should do the trick.

ionic build -- --mode development

Answered By – Adam C

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published