Ionic 如何在开发模式下运行“离子构建”?

oipij1gg  于 2022-12-08  发布在  Ionic
关注(0)|答案(3)|浏览(177)

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...
gcxthw6b

gcxthw6b1#

你可以试试

ionic build -lcs

或者,如果您正在尝试使用cordova,然后运行un device,请尝试以下命令注意:数据电缆必须始终连接到设备

ionic cordova build android --device -l

在仿真器中运行:

ionic cordova emulate android -l
gwbalxhn

gwbalxhn3#

我使用的是Ionic 6而不是5,但是在this answer中运行下面的共享命令应该可以做到这一点。

ionic build -- --mode development

相关问题