How to run `ionic build` in development mode?

Viewed 183

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:
https://github.com/browserslist/browserslist#browsers-data-updating
⠦  Building for production...
2 Answers

you can try

ionic build -lcs

or if you are trying with cordova then and run un device try this command note : datacable must be connect to device all the time

ionic cordova build android --device -l

run in emulator :

ionic cordova emulate android -l
Related